I am having trouble proving that if $r$ is a nilpotent element of a commutative ring $R$ then $(r)$ is not a direct summand of $R$ as an $R$-module. I know that $(r)$ is then a nilpotent ideal. I understand that it doesn't work when $R$ is not commutative, but only by an example - I don't see where it actually breaks down.
Thank you in advance for any help!
If $\langle r\rangle=Rr$ is a direct summand of $R$, then we have a split exact sequence $$\{0\}\to Rr\to R\to R/Rr\to\{0\}$$ hence there exists an $R$-module homomorphism $\pi:R\to Rr$ such that $\pi(ar)=ar$ for all $a\in R$. In particular, $\pi(r)=r$, hence $\pi(r^n)=r^{n-1}\pi(r)=r^n$ for all $n>0$. Let $\pi(1)=ur$ for some $u\in R$. Let $n$ be the smallest $n>0$ such that $r^n=0$. Then $r^{n-1}=\pi(r^{n-1})=r^{n-1}\pi(1)=ur^n=0$ - a contradiction.