Is there a known characterization of the rings $R$ (containing $1$) with this property: **every element of $R$ is a sum of two commuting idempotents**.



rings in which every element is a sum of two commuting idempotents
If $x$ and $y$ are two commuting idempotents, then $(x+y)^3 = x+y+6xy$, $(x+y)^2=x+y+2xy$, so $z=x+y$ satisfies the equation $z^3-3z^2+2z=0$. Plugging $z=3$ into the equation, we obtain $6=0$. So the ring is a product of a ring of characteristic $3$ and a ring of characteristic $2$.


In the ring of characteristic $2$, $(x+y)^2=(x+y)$, so every element is idempotent. This implies that the ring is commutative, because


$$0 = (a+b)-a-b=(a+b)^2-a^2-b^2 = ab+ba = ab-ba$$


So the ring is a Boolean algebra - the ring of locally constant functions to $\mathbb F\_2$ on a compact, totally disconnected topological space.


In the ring of characteristic $3$, as Clement points out the ring is commutative, because we have $a^3=a$, so if $a$ is invertible then $a^2=1$, so in the group of units every element has order $2$, so the group of units is commutative. But every element is the sum of two units: $a= (1-a-a^2) + (a^2-a-1)$, so the whole ring is commutative.


Being reduced, the intersection of all the prime ideals is $0$, but the field of fractions of a prime ideal is a field where every element is its own cube, hence is $\mathbb F\_3$. So the ring embeds into a product of copies of $\mathbb F\_3$. By the same logic as in the Boolean algebras case that the ring is the ring of locally constant functions to $\mathbb F\_3$ on a compact totally disconnected topological space:


Let $R$ be our ring, then $\operatorname{Spec} R$ is a topological space by standard ring theory. Since each prime ideal has quotien $\mathbb F\_3$, and element $x\in R$ corresponds to a function from this space to $\mathbb F\_3$. Since the sets $(x=0)$, $(x=1)$, $(x=2)$ are each closed, because they correspond to ideals, the function must be locally constant. Conversely, a locally constant function actually corresponds to an element of the ring since it locally looks like an element of the ring. The space is totally disconnected since each pair of distinct points must be distinguished by some locally constant function.


So the final answer is that such a ring consists of all the locally constant functions to $\mathbb F\_2$ and $\mathbb F\_3$, respectively, on a pair of compact, totally disconnected topological spaces. Conversely, any such ring will have every element the sum of two idempotents.


EDIT: In a ring where every element is the sum of $n$ commuting idempotents, every element will satisfy $\prod\_{i=0}^{n} (z-i)=0$, so by plugging in $n+1$, we will have $n!=0$. So the ring will decompose as a product of $p$-power parts for $p\leq n$ prime. Mod $p^k$, each element which is the sum of $n$ idempotents satisfies $\prod\_{i=0}^{\min(n, p^k-1)} (z-i)=0$. In particular, mod $p$ we will have $z^p-z=0$. So mod $2$ and mod $3$ the ring will still have the same form, but I think at some point (mod $4$? mod $5$? mod $7$?) it stops being necessarily commutative.


In the finite case, and the commutative case, things get simpler.


