TITLE: In a commutative ring, is the product of prime not a prime?
QUESTION [5 upvotes]: Suppose I have a commutative ring $R$ with $a, b \in R$ prime elements. Can $ab$ be a prime element?

Note: $x$ is a prime element if $x | cd$, then $x |c$ or $x|d$. This is distinct from an irreducible element (only divisible by $1$ and itself), which is closer to the notion of a prime number.
Another note, the ring must be commutative! If it's not, we could just choose the ring of matrices and let $$a = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} \quad b = \begin{pmatrix} 0 & 0 \\ 1 & 0 \end{pmatrix} \quad ab = \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix} $$
All of which are prime.

REPLY [12 votes]: It is always true that $ab\mid ab$. So suppose that $ab$ is prime. Without loss of generality, we may assume that $ab\mid a$. Then there exists $c\in R$ such that $abc = a$. This implies that $a(bc - 1) = 0$, so that $a$ is a zero divisor.
If $R$ is an integral domain, then either $a$ is zero, or $bc = 1$. However, the latter would contradict primeness of $b$, so that $a$ must be zero. In an integral domain, this is the only way that the product of two primes can again be prime - one of the two primes must be $0$.
If $R$ is not an integral domain, then one of the two primes must be a zero divisor, and there are nontrivial examples of the product of primes being prime. For example, consider the ring $R = \Bbb Z/6\Bbb Z.$ Then $2$ is prime (you can check this by hand, or you can compute that $R/2R\cong \Bbb F_2$). However, $4$ is also prime (again either check by hand or compute $(4) = (2)$). So, we have $2\cdot 2 = 4$, and $2$ and $4$ are both prime.