TITLE: Finite Rings and Product of Finite Fields
QUESTION [9 upvotes]: Here is the problem which I got inspired from, which is from one of our school's prelim exam:

Prove or disprove: If $R$ is a finite, commutative ring with unit, then it is a product of fields.

It is obviously true if $R$ has prime order (because in this case $R$ itself is a field). Now it remains the case with non-prime order. Since $R$ is finite order, if it can be written as a product of fields, then all the fields must be finite. By considering the total number of elements, it is natural to consider the prime factorization of the order of $R$.
In order to see the statement is true or false, I consider first as an example the ring $R=\mathbb{Z}/6\mathbb{Z}$. If it is a product of finite fields, then it can only be $F=\mathbb{F}_2\times\mathbb{F}_3$. It turns out the function $\phi:R\to F$ given by $\phi(0)=(0,0)$, $\phi(1)=(1,1)$, $\phi(2)=(0,2)$, $\phi(3)=(1,0)$, $\phi(4)=(0,1)$, $\phi(5)=(1,2)$ gives an isomorphism. In fact, it is THE isomorphism.
Given the example above, this makes me believe that the statement is true. However, problems continue to arise as I attempted to prove it:
(1) Given any finite commutative unital ring with order $n$, is it true that $R\cong \mathbb{Z}/n\mathbb{Z}$?
(2) We can consider two "types" of factorization and the proofs will go differently: If we let $n=p_1\cdots p_k$ be the prime factorization of $n$, then we consider the field product $\mathbb{F}_{p_1}\times\cdots\times \mathbb{F}_{p_k}$. If we let $n=p_1^{n_1}\cdots p_k^{n_k}$ to be the prime factorization and requiring all $p_i$ are distinct, then we can consider the field product $\mathbb{F}_{p_1^{n_1}}\times\cdots\times \mathbb{F}_{p_k^{n_k}}$
(3) How do one even construct an isomorphism? The one shown in our example seems to have no pattern at all.
If the statement is actually false, I would like to see some counterexamples. Further than that, what extra condition is necessary (and sufficient) for the statement to be true?

REPLY [4 votes]: As requested, I am converting my comments to an answer. 
It is not true that any finite ring is a product of fields. Indeed, consider $R := \mathbb{Z}/p^{k}\mathbb{Z}$ for a prime $p$ and a positive integer $k > 1$. Any product of reduced rings is reduced, and fields are certainly reduced, so if $R$ were a product of fields, then $R$ would necessarily be reduced. But we see that $R$ in fact has nilpotents: the nilradical of $R$ is the principal ideal generated by the residue class of $p$.  
On the other hand, suppose $R$ is a finite reduced ring. In this case, the claim is true. Any finite ring has finitely many ideals, and so must satisfy both chain conditions. In particular, $R$ is Artinian, and so is a product of finitely many Artin local rings. Any reduced Artin local ring is a field, and so this proves the claim. 
If we specialize to rings of the form $R = \mathbb{Z}/n\mathbb{Z}$, we can understand when $R$ is a product of fields in terms of the prime factorization of $n$. If $n = p_{1}^{k_{1}} \cdots p_{n}^{k_{n}}$ with $p_{i}$ distinct primes, then by the Chinese Remainder Theorem, we have 
$$R \cong \prod_{i=1}^{n} \mathbb{Z}/p_{i}^{k_{i}}\mathbb{Z}$$ 
which is reduced exactly when $k_{i} = 1$ for each $i$. In this setting, we therefore see that $R$ is a finite product of fields if and only if $n$ is squarefree.