A commutative unital ring is a field precisely when the zero ideal is maximal

Let $R$ be a commutative ring with $1 \neq 0$. Prove that $R$ is a field if and only if $0$ is a maximal ideal.

$(\Rightarrow)$ Suppose $R$ is a field. Let $I \subseteq R$ be an ideal which properly contains $0$; then there exists an element $a \neq 0$ in $I$. Since $R$ is a field, $a$ is a unit in $R$. By Proposition 9, $I = R$. Thus $R$ is the only ideal of $R$ which properly contains $0$, and hence $0$ is a maximal ideal in $R$.

$(\Leftarrow)$ Suppose $0$ is a maximal ideal in $R$. Now $R$ is commutative by hypothesis. Let $a \in R$ be nonzero. Then since $0$ is maximal, we have $(a) = R$. Since $1 \in R$, there exist elements $b,c \in R$ such that $ab = ca = 1$. By §7.1 #28, $a$ has a two-sided inverse. Thus every nonzero element of $R$ is invertible, and hence $R$ is a field.