TITLE: If every commutator is idempotent, then the ring is commutative
QUESTION [15 upvotes]: Let $R$ be a ring and for $x,y\!\in\!R$, define the commutator as $[x,y]:=xy-yx$. An $r\!\in\!R$ is idempotent iff $r^2=r$.
How can one prove, that if every commutator is idempotent, then the whole ring is commutative, i.e. all commutators are zero?

REPLY [10 votes]: Proof from "Two elementary generalisations of boolean rings" AMM Feb.1986:
Let $Z(R):=\{x\!\in\!R;\: \forall y\!\in\!R\!: xy=yx\}$ denote the center of the ring. We notice that 
    \begin{equation*}
        \label{eq:7.1}
        xy-yx=(xy-yx)^2=(yx-xy)^2=yx-xy.
        \tag*{(1)}
    \end{equation*}
First we show a general lemma, that if $xy\!=\!0$ implies $yx\!=\!0$ $(\ast)$, then every idempotent $e$ is central. For arbitrary $r\!\in\!R$ we have $(e^2\!-\!e)r=0=e(er\!-\!r)$ and by $(\ast)$ we have $0=(er\!-\!r)e=ere\!-\!re$. Similarly, from $r(e^2\!-\!e)=0=(re\!-\!r)e$ by $(\ast)$ we get $0=e(re\!-\!r)=ere\!-\!er$. Therefore $re=ere=er$ which proves $e\!\in\!Z(R)$.
Next we prove, that all commutators are central. This follows from the previous paragraph, because the condition $(\ast)$ holds: if $xy=0$, then $yx$ $=yx-xy$ $=(yx\!-\!xy)^2$ $=(yx)^2$ $=y(xy)x$ $=0$. We have proved, that 
    \begin{equation*}
        \label{eq:7.2}
        \forall x,y\in R:\; xy-yx\in Z(R).
        \tag*{(2)}
    \end{equation*}
Next we prove that all squares are central. This we get from the equality  $x(xy-yx)$ $\overset{(1)}{=}x(yx-xy)$ $\overset{(2)}{=}(yx-xy)x$, which tells us that $x^2y=yx^2$ , i.e.
\begin{equation*}
    \label{eq:7.3}
    \forall x\in R:\; x^2\in Z(R).
    \tag*{(3)}
\end{equation*}
Next we prove, that $(xy)^2=(yx)^2$. This we achieve via $(3)$ by writing $yxy$ as a sum of squares:
$$(xy)^2 =x(yxy)=x\big((yx)^2+y^2-(yx\!-\!y)^2-y^2x\big)$$
\begin{equation*}
    \label{eq:7.4}
    \overset{(3)} {=}\big((yx)^2+y^2-(yx-y)^2-y^2x\big)x=(yxy)x=(yx)^2
    \tag*{(4)}
\end{equation*}
Finally, we show that all elements are central:
$$xy\!-\!yx=(xy\!-\!yx)^2=xy(xy\!-\!yx)\!-\!yx(xy\!-\!yx) \overset{(1)}{=} xy(xy\!-\!yx)\!-\!yx(yx\!-\!xy)$$
$$= (xy)^2\!-\!xy^2x\!-\!(yx)^2\!+\!yx^2y\overset{(4)}{=}-\!xy^2x\!+\!yx^2y \overset{(3)}{=} -\!x^2y^2\!+\!x^2y^2=0$$
This completes the proof.