A commutative noetherian ring in which each ideal $I$ is principal and $I^2=I$ must be a finite product of fields 
PROBLEM A commutative noetherian ring $R$ in which each ideal $I$ is principal and $I^2=I$ must be a finite product of fields.

I am lost with the condition $I^2=I$ and the desired result "a finite product of fields". In particular, I totally don't know how to use the condition$I^2=I$? 
Also, I guess this question possibly do with the following question:

Let $R$ be a commutative ring with 1 in which each ideal is prime. Show
  that $R$ is a field.

Please help!
 A: Hint: A principal ideal $I$ statifying $I^2=I$ is simply an ideal generated by an idempotent. Since every ideal of $R$ is generated by an idempotent, the nilradical of $R$ (which contains nilpotent elements only) must be $(0)$, together  with the Noetherian property, $(0)$ is the intersection of finite many prime ideals. Moreover, since in an integral domain, the only idempotent elements are $0$ and $1$, all the prime ideals of $R$ are maximal.
A: As it is already noticed every ideal of $R$ is generated by an idempotent. Now just follow these steps:


*

*Every prime ideal of $R$ is maximal. If $p_1\subseteq p_2$, and $p_1=(e_1)$, $p_2=(e_2)$, from $e_2(1-e_2)=0\in p_1$ we get $e_2\in p_1$ hence $p_1=p_2$.

*$R$ is artinian. 

*$R$ is isomorphic to a finite direct product of artinian local rings. This is a consequence of the structure theorem for artinian rings.

*In a local ring the only idempotents are $0$ and $1$.

*A commutative ring having only two ideals is a field.

*$R$ is isomorphic to a finite direct product of fields.
A: By Nakayama's lemma, a principal ideal satisfying $I^2=I$ is generated by an idempotent, and is therefore a direct summand of $R$. 
Therefore all ideals are direct summands, meaning that $R$ is semisimple Artinian. By the Artin Wedderburn theorem, such a ring is a finite product of fields.
It's already been pointed out that as stated the Noetherian hypothesis is superfluous, since all ideals are finitely generated already. If you meant that all principal ideals satisfy $I^2=I$ then the above argument can be adapted in the following way.
You can conclude that all principal ideals are direct summands, therefore $R$ is Von Neumann regular, and a Noetherian VNR ring is semisimple Artinian.
