Fact 1. An ideal $I$ of $R$ is a prime ideal if and only if $R/I$ is an integral domain.

Fact 2. An ideal $I$ of $R$ is a maximal ideal if and only if $R/I$ is a field.

Let $M$ be a maximal ideal of $R$. Then by Fact 2, $R/M$ is a field.
Since a field is an integral domain, $R/M$ is an integral domain. Thus by Fact 1, $M$ is a prime ideal.

Proof 2.

In this proof, we solve the problem without using Fact 1, 2.
Let $M$ be a maximal ideal of $R$.

Seeking a contradiction, let us assume that $M$ is not a prime ideal.

Then there exists $a, b\in R$ such that the product $ab$ is in $M$ but $a \not \in M$ and $b \not \in M$.

Consider the ideal $(a)+M$ generated by $a$ and $M$.
Since the ideal $(a)+M$ is strictly larger than $M$, we must have $R=(a)+M$ by the maximality of $M$.

Since $1\in R=(a)+M$, we have
\[1=ra+m,\]
where $r\in R$ and $m\in M$.

Similarly, we have $R=(b)+M$ and
\[1=sb+n,\]
where $s\in R$ and $n\in M$.

From these equalities, we obtain
\begin{align*}
1&=1\cdot 1\\
&=(ra+m)(sb+n)\\
&=rsab+ran+msb+mn.
\end{align*}

Since $ab, m, n$ are elements in the ideal $M$, the last expression is in $M$.

This yields that $1\in M$, and hence $M=R$. Since a maximal ideal is a proper ideal by definition, this is a contradiction.
Thus, $R$ must be a prime ideal.

Prime ideals are Not Necessarily Maximal

We just have shown that every maximal ideal is a prime ideal.

The converse, however, is not true.

That is, some prime ideals are not maximal ideals.

Every Prime Ideal is Maximal if $a^n=a$ for any Element $a$ in the Commutative Ring
Let $R$ be a commutative ring with identity $1\neq 0$. Suppose that for each element $a\in R$, there exists an integer $n > 1$ depending on $a$.
Then prove that every prime ideal is a maximal ideal.
Hint.
Let $R$ be a commutative ring with $1$ and $I$ be an ideal […]

In a Principal Ideal Domain (PID), a Prime Ideal is a Maximal Ideal
Let $R$ be a principal ideal domain (PID) and let $P$ be a nonzero prime ideal in $R$.
Show that $P$ is a maximal ideal in $R$.
Definition
A commutative ring $R$ is a principal ideal domain (PID) if $R$ is a domain and any ideal $I$ is generated by a single element […]

Characteristic of an Integral Domain is 0 or a Prime Number
Let $R$ be a commutative ring with $1$. Show that if $R$ is an integral domain, then the characteristic of $R$ is either $0$ or a prime number $p$.
Definition of the characteristic of a ring.
The characteristic of a commutative ring $R$ with $1$ is defined as […]

If Every Proper Ideal of a Commutative Ring is a Prime Ideal, then It is a Field.
Let $R$ be a commutative ring with $1$.
Prove that if every proper ideal of $R$ is a prime ideal, then $R$ is a field.
Proof.
As the zero ideal $(0)$ of $R$ is a proper ideal, it is a prime ideal by assumption.
Hence $R=R/\{0\}$ is an integral […]

$(x^3-y^2)$ is a Prime Ideal in the Ring $R[x, y]$, $R$ is an Integral Domain.
Let $R$ be an integral domain. Then prove that the ideal $(x^3-y^2)$ is a prime ideal in the ring $R[x, y]$.
Proof.
Consider the ring $R[t]$, where $t$ is a variable. Since $R$ is an integral domain, so is $R[t]$.
Define the function $\Psi:R[x,y] \to R[t]$ sending […]

If the Localization is Noetherian for All Prime Ideals, Is the Ring Noetherian?
Let $R$ be a commutative ring with $1$.
Suppose that the localization $R_{\mathfrak{p}}$ is a Noetherian ring for every prime ideal $\mathfrak{p}$ of $R$.
Is it true that $A$ is also a Noetherian ring?
Proof.
The answer is no. We give a counterexample.
Let […]

If a Prime Ideal Contains No Nonzero Zero Divisors, then the Ring is an Integral Domain
Let $R$ be a commutative ring. Suppose that $P$ is a prime ideal of $R$ containing no nonzero zero divisor. Then show that the ring $R$ is an integral domain.
Definitions: zero divisor, integral domain
An element $a$ of a commutative ring $R$ is called a zero divisor […]