TITLE: If $R$ is a commutative ring with unity and $R$ has only one maximal ideal then show that the equation $x^2=x$ has only two solutions
QUESTION [9 upvotes]: If $R$ is a commutative ring with unity and $R$ has only one maximal ideal then show that the equation $x^2=x$ has only two solutions.

I know that $0$ and $1$ are the solutions, but I can't proceed from there.

REPLY [3 votes]: Suppose that $r \in R$ satisfies $r^2=r$.  Since $(r)+(1-r)=R$, one of the principal ideals $(r)$ or $(1-r)$ is not contained in the maximal ideal $M$.  But then $(r)=R$ or $(1-r) = R$, i.e. $r$ or $1-r$ is a unit.
If $x$ is a unit satisfying $x^2=x$, then $x=1$ (dividing by $x$).  Thus $r=1$ or $1-r=1$.