Q:

Show that any proper ideal I of the ring R is the intersection of all prime ideals which contain it

Question:Suppose R is a ring with identity 1. Also,we have $x^2=x$ for any x in R. Then how to prove that any proper ideal I of R is the intersection of all prime ideals which contain it?
Firstly, based on $x^2=x$, we can get 2x=0 for each x in R. And we also can prove the ring R is commutative. Then, give any prime ideal P of R, we can prove that $R/P$ is isomorphic to $Z/2Z$(that is because given any x in R but x is not in P, we can know that $x^2+P=x+P$(since $x^2=x$), then we have $x^2-x=x(x-1)\in P$. if so, based on P is prime ideal, we can know x-1 in P(since x is not in P). If so, we have $x+P=1+P$. It implies that we only have two elements in R/P, and they are P and 1+P,that's why R/P is isomorphic to Z/2Z). Now how can I prove the question above? I am not sure whether those properties and conclusions above are useful to help to prove my question? Can someone tell me how to solve this problem?  

A:

Here is an alternate argument that does not use the fact that the intersection of all primes is the nilradical, only the fact that maximal ideals exist.  As Qiaochu says, you wish to show that if $x\in R/I$ is nonzero, there is some prime ideal that does not contain it.  To show this, you can show the following.  If $x\neq 0$, then since $x(1-x)=0$, $1-x$ is not a unit.  Thus there is a maximal ideal $M$ containing $1-x$.  Such a maximal ideal then does not contain $x$.
(Actually, this is secretly the same as using the fact that the intersection of all primes is the nilradical, since you prove that fact by using the existence of maximal ideals in the localization $R[x^{-1}]$.  It just happens that if $x=x^2$, that localization can be identified with $R/(1-x)$.)

