If $x^2=x$ and $x$ is non-unit then $x$ is a zero divisor in a ring $R$.
I am trying to prove the contrapositive statement, that is Suppose $x$ is not a zero divisor and trying to show that $x$ is unit. I am just using the definition for nonzero $r\in R$: $x^2r-xr=0\implies x(xr-r)=0\implies xr=r$ and eventually I get $x=1$ which says it is a unit. Is this correct. Also, is there a direct way of proving this claim?
From $x(1-x)=0$ and $x$ nonzero divisor what you get?