TITLE: How to show that every prime ideal is a maximal ideal if for all $a \in R$ there exists $b \in R$ such that $a^2b=a$.
QUESTION [6 upvotes]: Here is the full statement of the question (I thought it was a bit too long for the title).

Given a commutative ring $R$ with $1 \neq 0$ such that for all $a \in R$ there exists $b \in R$ such that $a^2b=a$. Show that in $R$ every prime ideal is maximal.

I was trying to show that every ideal wich has a prime ideal as a strict subset is $R$. I was trying to do this by showing that $1$ would be an element of such an ideal. 
Thanks!

REPLY [9 votes]: Consider the quotient $A=R/\mathfrak p$  of $R$ modulo a prime ideal $\mathfrak p$.
In $A$ we still have the property that for each $a\in A$ there exists $b$ with $a^2b=a$, i.e. $a(ab-1)=0$. Since $A$ has no zero-divisors, this implies $ab=1$ if $a\ne 0$. In other words, $A$ is a field and hence $\mathfrak p$ maximal. 

Of course the argument can also be carried out directly in $R$, but the view via the quotients is where the proof "comes from": Let $\mathfrak m$ be a maximal ideal containing $\mathfrak p$ and assume there exists $a\in\mathfrak m\setminus\mathfrak p$. Using $a^2b=a$ for some $b\in R$ we obtain $a(ab-1)=0\in\mathfrak p$, hence $ab-1\in \mathfrak p\subseteq\mathfrak m$. As $a\in\mathfrak m$, this implies $1\in\mathfrak m$, contradiction.