TITLE: Alternative proof of $I$ maximal implies $I$ prime
QUESTION [12 upvotes]: The proof I know to show maximal implies prime for an ideal $I$ in a commutative ring $R$ goes as follows:
$I$ maximal $\iff$ $R/I$ is a field $\implies$ $R/I$ is an integral domain $\iff$ $I$ is prime.
Surely, it has to be possible to show the same as follows:
Let $I$ be maximal and $ab \in I$. Assume $a \notin I$. Then $I$ is properly contained in $I + (a)$ and hence $1 \in I + (a)$ that is, there exists $r \in R$ and $i \in I$ such that $i + ra = 1$. Similarly, one can find $i^\prime$ and $r^\prime$ such that $i^\prime + r^\prime b = 1$. So we get that $ra - r^\prime b \in I$. 
Now I'm stuck. How can I deduce that either $a$ or $b$ have to be in $I$?

REPLY [5 votes]: The proof that you seek works more generally and it is highly instructive to present it this way. Notice that an ideal $\rm\:P\:$ is prime iff its complement $\rm\:\overline P\:$ is a monoid, i.e. $\rm\:a,b\not\in P\:\Rightarrow\:ab\not\in P.\:$ Krull discovered a very useful generalization of this primality test, namely $(3)$ below, which states that prime ideals are precisely the ideals that are maximal in the complement of some multiplicative submonoid M of the ring, i.e. ideals maximal w.r.t. not meeting M.
Theorem $\ $ TFAE for an ideal $\rm\:P\:$ in a ring $\rm\:R.$
$\rm(1)\ \ \:P\:$ is prime.
$\rm(2)\ \ \:\overline P\:$ is a submonoid $\rm\:M\:$ of $\rm\:R\:$$ $ (where $\rm\:\overline S := R\backslash S = $ set-theoretic complement of $\rm\:S\:$ in $\rm\:R)$
$\rm(3)\ \ \: P\:$ is an ideal maximal in $\rm\:\overline M\:$ for a  monoid $\rm\:M\subseteq \left<R,*\right>,\:$ i.e. ideal $\rm\:I\supsetneq P\Rightarrow I\cap M\ne \{\ \}$
Proof $\ (1 \Rightarrow 2)\ $ Since  $\rm\:P\:$ is prime, $\rm\:a,b\not\in P\:\Rightarrow\:ab\not\in P,\:$ i.e. $\rm\:a,b\in \overline P\:\Rightarrow\:ab\in \overline P.\:$ Furthermore $\rm\:1\in \overline P,\:$ hence $\rm\:\overline P\:$ is a submonoid of $\rm\:M.$
$(2\Rightarrow 3)\ $ Let $\rm\: M = \overline P.$
$(3\Rightarrow 1)\ $ Assume $\rm\:a,b\not\in P.\:$ Then $\rm\:P + (a)\supsetneq P\:$ so it meets $\rm\:M,\:$ i.e. $\rm\ m = p + a\:\!r\in M,\ p\in P.\:$ Similarly $\rm\:P + (b)\supsetneq P\:$ $\Rightarrow$ $\rm\: m' = p'+b\:\!r'\in M,\ p'\in P.\:$ Therefore
$$\rm\ \ \ ab\in P\ \Rightarrow\ mm' = (p+a\:\!r)(p'+b\:\!r') \in P \cap M = \{\ \}\ \Rightarrow\Leftarrow$$
So, having proved $\rm\:ab\not\in P\:$ when $\rm\:a,b\not\in P,\:$ we deduce that $\rm\:P\:$ is prime. $\ \ $ QED
Your result is simply the special case $\rm\:M = \{1\},\:$ since $\rm\:P\:$ is maximal in $\rm\:\overline{\{1\}}\:$ iff $\rm\:P\:$ is maximal.  Notice, in particular, that the proofs in the other answers are essentially the same as the proof above of $(3\Rightarrow 1)$ for the special case $\rm\:M = \{1\}.$ But the proof for general $\rm\:M\:$ is no more difficult. Further, this view is well-worth knowing, since it lends insight into the essence of that matter.
Krull's criterion is useful because  any ideal disjoint from a monoid $\rm\:M\:$ can, by Zorn's Lemma, be expanded to one maximally so. This yields a frequently useful method for contructing prime ideals. The essence of the matter is clarified when one studies local-global methods, in particular the important technique of localization, e.g see here and see here. From this viewpoint, the ideals in $(3)$ are simply ideals that extend to maximal ideals in the localization $\rm\:M^{-1} R,\:$ and their primality follows from general principles.