A commutative ring whose all proper ideals are prime is a field. [closed]

Let $R$ be a commutative ring with $1$. Suppose that all ideals $I \neq R$ are prime. Prove that $R$ is a field.

Help me some hints.

Thanks a lot.


First show that $R$ is a domain, by a suitable choice of ideal.

Then let $x \ne 0$, and deduce consequences from the fact that $xx \in x^2 R$.


Hint: Consider some $r\in R$ and examine the principal ideal generated by $r^2$.