Let A a commutative ring with unity in which every element is idempotent ($x^n=x$ for some n>1 dependent on x), then every prime ideal is maximal. Let $A$ a commutative ring with unity in which every element is idempotent ($x^n=x$ for some n>1 dependent on $x$), then every prime ideal is maximal.
I came across this question revisiting Atiyah's Intro to Commutative Algebra for my comp, and even though it seems very simple I'm stuck. From the theorems I have available, I can only think of the quotient ring route, somehow using idempotence to show that A/p is not only an integral domain, but also a field, so that p is maximal. But I got nowhere with that approach. Any ideas are appreciated.

Let $P\subset A$ be a prime ideal.  Then the ring $A/P$ is a domain which also satisfies that for all $x\in A/P$, $x^n=x$ for some $n>1$.  Let us show that such a domain must be a field, so $P$ is maximal.
Suppose $x\in A/P$ is nonzero, and $x^n=x$.  Then $0=x^n-x=x(x^{n-1}-1)$.  Since $A/P$ is a domain and $x\neq 0$, $x^{n-1}-1=0$.  Thus $x$ is a unit, with inverse $x^{n-2}$.  We conclude that every nonzero element of $A/P$ is a unit, so $A/P$ is a field.
