A finite commutative ring with 1 whose elements satisfy a particular equation I would be very grateful if you give me a hint on it:

Suppose $R$ is a finite commutative ring with identity such that $ x^3 = x $  for all elements $x$ of $R$. Then $R$ is a finite direct product of fields of order $2$ or $3$.

Should I try to incorporate Artin-Wedderburn?
Thanks!
 A: Since $R$ is a finite ring, it is Artinian, hence is a finite product of Artinian local rings. Moreover $x^3 = x$ for all $x$ implies $R$ is reduced ($0 = x^m \implies 0 = x^{3^k} = x$ for some $k$). Thus $R \cong \prod_{i=1}^n R_i$, where each $R_i$ is finite, local, and reduced, hence is a finite field. Then each $R_i$ also satisfies $x^3 = x$ for all $x \in R_i$, but the only finite fields satisfying this are $\mathbb{F}_2$ and $\mathbb{F}_3$ (recall that a finite field of order $p^n$ is the splitting field of $x^{p^n} - x$).
Edit: Since one of the anwers mentioned that commutativity can be dropped, let me just add that the hypothesis of a unity can also be dropped: see e.g. this question.
A: For any $x$, we have that $x^2$ is idempotent. Pick an $x \neq \pm 1, 0$ (if none exists we're done) and decompose $R$ into the direct sum of $x^2R$ and $(1-x^2)R$. These are smaller finite rings (caution: the unit element of these rings is not the $1$ of the big ring) so this process cannot continue forever and so you win.
A: I'd like to point out that the commutativity assumption can be removed. A theorem of Jacobson says that any ring with unit satisfying $a^{n(a)}=a$, with $n(a)>1$ an integer depending on $a$, is commutative. This is part of a large collection of ring theory results assuring commutativity, and can be found in Herstein's book Noncommutative Rings.
Indeed, the first step of the proof shows that $R$ is semisimple by considering $a(1-a^{a(n)-1})=0$. Thus we can apply Artin-Wedderburn to write $R$ as a sum of matrices over division rings. Commutativity implies the matrices are all $1\times 1$, so $R$ is a sum of division rings. Commutativity, or finiteness and an overpowered use of Wedderburn's theorem, implies the division rings are fields. The orders of the fields are then restricted by the specific relation $x^3=x$, as desired.
Indeed, we don't have to invoke Jacobson. We have semisimple by the same argument, Artin-Wedderburn applies, and $a^{n(a)}=a$ means we have no nilpotent elements. Any $n\times n$ matrix ring has nilpotents if $n>1$, so $R$ is a sum of division rings. By finiteness, Wedderburn's theorem applies to conclude the division rings are fields (whence $R$ is commutative).
A: One remark not in any of the other answers:
although you don't need to observe it directly (it comes out later in the
other arguments presents), you can notice that $2^3 = 2$, and hence that $6 = 0$,
in $R$, so that by the CRT, the ring $R$ is a product of an $\mathbb F_2$-algebra and
an $\mathbb F_3$-algebra.  
This doesn't particularly simplify the rest of the arguments, but it might
simplify your conceptualization of the problem and its solution, since it makes
it clear from that the beginning that $R$ is the product of something of char. $2$ and something of char. $3$.
A: Here is a collection of facts which may or may not serve as hints:


*

*Every prime ideal of $R$ is maximal

*The zero ideal is the intersection of all the prime ideals in $R$

*$R \simeq R / (0)$


Edit
As requested, I'll expand this into a more complete answer.
Since $R$ is finite, for any prime ideal $\mathfrak{p}$, $R / \mathfrak{p}$ is a finite integral domain, and thus is a field, and so $\mathfrak{p}$ is maximal. In fact, since every element of $R/\mathfrak{p}$ satisfies $x^3 - x = 0$, $R/\mathfrak{p}$ is a field with at most 3 elements, and so is either $\Bbb{F}_2$ or $\Bbb{F}_3$.
The condition that $x^3 = x$ prevents $R$ from having a nilradical that isn't the zero ideal. Since $R$ is finite, there are only a finite number of prime ideals, say $\mathfrak{p}_1, \dots, \mathfrak{p_n}$. It follows that $$ \prod_{i=1}^n \mathfrak{p}_i = \bigcap_{i=1}^n \mathfrak{p}_i= (0) .$$
Since each $\mathfrak{p}_i$ is maximal, the prime ideals are pairwise comaximal, so the Chinese Remainder Theorem gives $$R \simeq R/(0) \simeq \prod_{i=1}^n  R/\mathfrak{p}_i.$$
The comment before shows that the terms in the product are fields of order 2 or 3.
