For groups, the subgroups you can divide by are the normal ones. For rings, they are the ideals: additive subgroups that swallow products with anything in the ring. The multiples of $n$ in $\mathbb{Z}$ are the model.
Definition. An ideal of a commutative ring $R$ is an additive subgroup $I$ such that $ra \in I$ for every $r \in R$ and $a \in I$. (In a noncommutative ring a two-sided ideal also needs $ar \in I$.) Ideal test: $I$ is nonempty, $a - b \in I$ and $ra \in I$ for all $a, b \in I$, $r \in R$.
Principal ideals. For $a \in R$ (commutative, with $1$), $(a) = \{ra : r \in R\}$ is the smallest ideal containing $a$. More generally $(a, b) = \{ra + sb : r, s \in R\}$.
Why it works
Proof. If $I = \{0\}$, it is $(0)$. Otherwise $I$ contains a positive number (if $a \in I$ then $-a \in I$); let $n$ be the smallest. Then $(n) \subseteq I$. For $a \in I$ divide: $a = nq + r$ with $0 \le r \lt n$; then $r = a - qn \in I$, so $r = 0$ by the choice of $n$. Hence $I = (n)$. $\square$ This is the same argument that showed subgroups of cyclic groups are cyclic. Consequences in $\mathbb{Z}$: $(a, b) = (\gcd(a, b))$ (Bézout), $(a) \cap (b) = (\operatorname{lcm}(a, b))$ and $(a)(b) = (ab)$.
In $\mathbb{Z}_{n}$, every additive subgroup $\langle d \rangle$ is automatically an ideal ($r \cdot kd = (rk)d$ is again a multiple of $d$), so the ideals are $(d)$ for $d \mid n$, one for each divisor.
Worked example: Ideals of $\mathbb{Z}$
- $(12, 18) = (\gcd(12, 18)) = (6)$.
- $(4) \cap (6)$: common multiples of $4$ and $6$, so $(12)$.
- $(4) + (6) = \{4r + 6s\} = (2)$.
Answer: $(6)$, $(12)$, $(2)$.
Worked example: An ideal of $\mathbb{Z}[x]$
- $0 \in I$, and $(f - g)(0) = f(0) - g(0)$ is even when both are.
- For any $r \in \mathbb{Z}[x]$, $(rf)(0) = r(0)f(0)$ is even.
- It is the ideal $(2, x)$: the polynomials $2a(x) + x\,b(x)$.
Answer: Yes.
A field $F$ has only the ideals $\{0\}$ and $F$: an ideal containing $a \ne 0$ contains $a^{-1}a = 1$ and then every $r = r \cdot 1$.
Common mistake
Key idea