In $\mathbb{Z}$, if $ab = 0$ then $a = 0$ or $b = 0$; that is how you solve $(x - 2)(x - 3) = 0$. In other rings this can fail: $2 \cdot 3 = 0$ in $\mathbb{Z}_{6}$. The rings where it holds are the ones where algebra behaves the way you expect.
Definitions. In a commutative ring, $a \ne 0$ is a zero divisor if $ab = 0$ for some $b \ne 0$. An integral domain is a commutative ring with identity $1 \ne 0$ and no zero divisors. A field is a commutative ring with $1 \ne 0$ in which every nonzero element is a unit. Examples of fields: $\mathbb{Q}$, $\mathbb{R}$, $\mathbb{C}$, $\mathbb{Z}_{p}$. Integral domains that are not fields: $\mathbb{Z}$, $\mathbb{Z}[x]$.
Why it works
(2) Cancellation. In an integral domain, $ab = ac$ with $a \ne 0$ gives $a(b - c) = 0$, so $b = c$.
(3) $\mathbb{Z}_{n}$ is a field exactly when $n$ is prime. If $n = rs$ with $1 \lt r, s \lt n$, then $rs = 0$ in $\mathbb{Z}_{n}$: zero divisors. If $n = p$ is prime, every $a \ne 0$ has $\gcd(a, p) = 1$, so it is a unit.
(4) A finite integral domain is a field. For $a \ne 0$, the map $x \mapsto ax$ is one-to-one by cancellation, hence onto (the ring is finite), so $ax = 1$ for some $x$. $\square$
Worked example: Zero divisors of $\mathbb{Z}_{12}$
- $a \ne 0$ is a zero divisor exactly when $\gcd(a, 12) \gt 1$: then $a \cdot \frac{12}{\gcd(a, 12)} \equiv 0$.
- $2, 3, 4, 6, 8, 9, 10$; for example $8 \cdot 3 = 24 \equiv 0$.
Answer: $\{2, 3, 4, 6, 8, 9, 10\}$; the other nonzero elements are units.
Worked example: Solving when you cannot cancel
- In $\mathbb{Z}_{12}$, $4$ is a zero divisor, so we cannot cancel. Testing: $x = 2, 5, 8, 11$ all give $4x \equiv 8$.
- In the field $\mathbb{Z}_{7}$, $3^{-1} = 5$, so $x = 5 \cdot 5 = 25 \equiv 4$. Check: $3 \cdot 4 = 12 \equiv 5$.
Answer: $x \in \{2, 5, 8, 11\}$; and $x = 4$.
Worked example: Products of rings
- $(1, 0) \cdot (0, 1) = (0, 0)$ with both factors nonzero.
Answer: No, though each factor is a field.
Common mistake
Key idea