TITLE: Proving a ring in which $r^n=r$ for all $r$ is commutative.
QUESTION [14 upvotes]: Let $R$ be a ring with identity such that there is a positive integer $n\geq 2$ for which $r^n=r$ for all $r\in R$. Prove $R$ is commutative.
I had proven before that If $n=2$ it is commutative as follows:
$r+s=(r+s)^2=r^2+rs+sr+r^2=r+rs+sr+s\implies 0=rs+sr\implies sr=-rs$
On the other hand $-r=(-1)r=(-1)^2r=r$.
So $sr=-rs=rs$ as desired.
I seem to be stumped even with $n=3$.

REPLY [2 votes]: The proof is found in the literature but is perhaps too long for an answer here on math.SE. We have long suffered from a lack of a canonical answer for this question, so this is an attempt at an approximation to one.

Even more is true:

If for each $x$ there exists an integer $n(x)>1$ such that $x^{n(x)}-x$ is in the center of $R$, then $R$ is commutative.

There are a few proofs in the literature, ones which are probably too long for a post here.
You should consult your local library to obtain a copy of one of these (probably preferring the newest one you can get):

N. Jacobson, "Structure theory for algebraic algebras of bounded degree", Ann. of Math. 46 (1945), 695–707.
Herstein, I. N. "An elementary proof of a theorem of Jacobson", Duke Mathematical Journal 21.1 (1954): 45-48.
Rogers, Kenneth. "An elementary proof of a theorem of Jacobson", Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg. Vol. 35. No. 3. Springer Berlin/Heidelberg, 1971.

A proof of an even more general nature is also discussed as Theorem 3.2.3 in:

Herstein, Israel Nathan. Noncommutative rings. Vol. 15. American Mathematical Soc., 1994.

There are also useful related questions on this site:

$x^n = x$ implies commutativity, a universal algebraic proof?