I'm considering this particular statement of the Peirce decomposition of a ring:
If a commutative unital ring $R$ can be written as an internal direct sum of two of it's proper ideals $I$ and $J$, so $R = I \oplus J$, then there exists an idempotent element $e \in R$ such that $I = eR$ and $J = (1-e)R$.
Since $R$ is an internal direct sum of $I$ and $J$, there is some $e \in I$ and $f \in J$ such that $e+f=1$ (then $f = 1-e$). How do you prove that $e$ is idempotent though? I've written out that \begin{align*} e+f &= 1 \\(e+f)^2 &= 1^2 \\e^2+f^2 &= 1 \qquad \text{since $ef=0$ because $IJ = 0$} \\e^2 + (1-e)^2 &= 1 \\e^2 + 1 -2e + e^2 &= 1 \\2e^2 -2e &= 0 \end{align*}
And this implies that $e$ is idempotent if the characteristic of the ring is not $2$! Is there a way to prove $e$ is idempotent that avoids this tiny snag?
Just observe that $ef=0$ means $e(1-e)=0$ so $e-e^2=0$ and $e^2=e$.