Direct Product iff Nontrivial Idempotent

Theorem
Let $R$ be a commutative ring with unity whose zero is $0_R$ and whose unity is $1_R$.

Then $R$ is the direct product of two non-trivial rings $R$ contains an idempotent element not equal to $0_R$ or $1_R$.

Proof
If $R$ has a nontrivial decomposition $R = R_1 \times R_2$ then $\tuple {1_R, 0_R}$ is a non-trivial idempotent element of $R$.

Conversely suppose there is $0_R, 1_R \ne e \in R$ with $e^2 = e$.

Let $R_1 = \ideal e$, the ideal generated by $e$, and $R_2 = R / \ideal e$.

Since $e \paren {e - 1_R} = 0_R$, it follows by definition that $e$ is a zero divisor.

So by Unit Not Zero Divisor it is not a unit.

Therefore, $1 \notin R_1$ and $\ideal e \subsetneqq R$.

Also $R_1 \cap R_2 = \set {0_R}$ so the product is direct (that is, the Universal Property for Direct Products is satisfied).

Finally we define the "gluing homomorphism" $\phi : R \to R_1 \times R_2$ by


 * $\phi: a \mapsto \tuple {a e, a + \ideal e}$

which is easily shown to be an isomorphism.