Prove that every maximal ideal of a commutative ring $R$ (not assumed to have $1$) with $R^2=R$ is prime.
If $M$ is a maximal ideal of $R$, I am trying to prove that for all $a,b,ab \in M$ implies $a\in M$ or $b \in M$, but I find it hard to applying the condition $R^2=R$. It can be translated to $r=ab$, but I don't know how to continue.
Start with $a,b\in R$ such that $ab\in M$. Now write $a = cd$ using the condition $R^2 = R$.
If we assume $a\not\in M$, then $c$ can be written in the form $c= na+xa+m$ since $M$ was maximal, and thus the ideal $\{na+xa+m: n\in \Bbb Z, x\in R, m\in M\}$ is the whole of $R$. We similarly can write $d = n'b+yb+m'$ if we assume $b\not\in M$. We now have $$ a = cd = (na+xa+m)(n'b+yb+m')\\ = nn'ab + nyab+nam+n'xab+n'bm+xyab+xam'+ybm+mm' \in M $$
This is a contradiction, so we must have $a\in M$ or $b\in M$.
edit: It occurs to me that the proof is probably more succinct as follows: $ab \in M$ means $\langle a\rangle \langle b\rangle = \langle ab \rangle \subset M$. If we assume $a,b\not\in M$ then maximality gives $\langle a\rangle + M = \langle b\rangle + M = R$. Then we have: $$ R = R^2 = (\langle a\rangle + M )(\langle b\rangle + M) \subset \langle a\rangle\langle b\rangle + \langle a\rangle M + \langle b\rangle M + M^2 \subset M $$ This is a contradiction.