Dividing a ring by an ideal can make it nicer or nastier. $\mathbb{Z}/5\mathbb{Z}$ is a field; $\mathbb{Z}/6\mathbb{Z}$ is full of zero divisors. This page answers the question "what does $I$ have to look like for $R/I$ to be a field, or at least an integral domain?" The answers are two special kinds of ideals, and the matching is perfect: maximal ideals give fields, prime ideals give integral domains.
Let's start with two quotients that look almost identical and turn out completely different. We'll work over the two-element field.
$\mathbb{F}_2 = \mathbb{Z}/2\mathbb{Z}$. In $\mathbb{F}_2$, $-1 = 1$, so signs never matter.
$R = \mathbb{F}_2[x]$, $I = (x^2 + x + 1) = \{f(x)(x^2 + x + 1) : f(x) \in \mathbb{F}_2[x]\}$.
$R/I = \{a_0 + a_1 x + I : a_0, a_1 \in \mathbb{F}_2\} = \{0+I,\ 1+I,\ x+I,\ (1+x)+I\}$.
$$\begin{array}{c|cccc} \cdot & 0 & 1 & x & 1+x \\ \hline 0 & 0 & 0 & 0 & 0 \\ 1 & 0 & 1 & x & 1+x \\ x & 0 & x & 1+x & 1 \\ 1+x & 0 & 1+x & 1 & x \end{array}$$
Scratch: $I = (x^2+x+1)$.
$|(R/I)^\times| = 3$. Conclusion: $R/I$ is a field of order $4$. ($R/I \cong \mathbb{F}_4$.)
Every nonzero row of that table has a $1$ in it, so every nonzero element is a unit. Now change one coefficient.
$R = \mathbb{F}_2[x]$, $I = (x^2 + 1)$.
$R/I = \{a_0 + a_1 x + I : a_0, a_1 \in \mathbb{F}_2\}$. (Note: $x^2 + 1 = (x+1)^2$ in $\mathbb{F}_2[x]$.)
$$\begin{array}{c|cccc} \cdot & 0 & 1 & x & 1+x \\ \hline 0 & 0 & 0 & 0 & 0 \\ 1 & 0 & 1 & x & 1+x \\ x & 0 & x & 1 & 1+x \\ 1+x & 0 & 1+x & 1+x & 0 \end{array}$$
Scratch:
Moral: $x^2+1$ is not irreducible over $\mathbb{F}_2$ $\implies R/I$ is not a field.
Same size, same additive group, completely different multiplication. The difference is that $x^2 + x + 1$ can't be factored over $\mathbb{F}_2$ and $x^2 + 1 = (x + 1)^2$ can. Here are all four monic quadratics over $\mathbb{F}_2$, and some over $\mathbb{F}_3$ too. Tap any cell to see its scratch work.
The units of the first quotient are $\{1, x, 1 + x\}$, a group of order $3$. By Groups of Order 1–3 it has to be cyclic, and it is: $x^2 = 1 + x$ and $x^3 = x(1 + x) = 1$, so $x$ generates it.
To explain what we just saw, we need a way to recognize fields from their ideals. It starts with a simple observation about units. Assume from here to the end of the page that $R$ has $1 \neq 0$.
If $R$ has $1 \neq 0$ and $I \subseteq R$ is an ideal then: $I = R$ if and only if $I$ contains a unit.
Proof. If $I = R$ then $1 \in I$. If $I$ contains a unit $u \in I$ then $u^{-1} u \in I$ ($I$ is an ideal) $\implies 1 \in I \implies R = (1) \subseteq I \implies R = I$. $\blacksquare$
A field has every nonzero element as a unit, so any nonzero ideal contains a unit and is the whole field. That gives a characterization of fields purely in terms of ideals.
If $R$ is a commutative ring with $1 \neq 0$ then $R$ is a field $\iff$ its only ideals are $(0)$ and $R$.
Proof. ($\Rightarrow$) A nonzero ideal contains a nonzero element, which is a unit, so the ideal is $R$ by the Proposition.
($\Leftarrow$) Let $a \neq 0$. Then $(a) \neq (0)$, so $(a) = R \ni 1$. Since $R$ is commutative, $(a) = \{ra : r \in R\}$, so $ra = 1$ for some $r$. $\blacksquare$
A surprising consequence: homomorphisms out of a field can't lose information.
If $R$ is a field then any non-trivial ring homomorphism $\phi : R \rightarrow S$ is injective.
Proof. $\ker \phi$ is an ideal of $R$ and $\ker \phi \neq R$ (since $\phi$ is not the zero map) $\implies \ker \phi = \{0\}$. $\blacksquare$
So fields are the rings with no ideals in between $(0)$ and everything. The ideals that leave no room above themselves get a name.
A maximal ideal $M$ in a ring $R$ is an ideal which is not all of $R$ ($M \subsetneq R$), and is not contained in any other proper ideal.
In other words, if $M \subseteq J \subseteq R$ for an ideal $J$, then $J = M$ or $J = R$. Do maximal ideals always exist? For rings with $1$, yes, though the proof needs some heavy machinery.
If $R$ has $1$ then every proper ideal of $R$ is contained in a maximal ideal.
Proof. Let $I$ be a proper ideal. Apply Zorn's Lemma to the collection $\mathcal{S}$ of all proper ideals of $R$ that contain $I$, partially ordered by inclusion. $\mathcal{S}$ is non-empty since $I \in \mathcal{S}$.
Let $\mathcal{C} \subseteq \mathcal{S}$ be a chain (any two members are comparable; it can be uncountable). Let $U = \bigcup_{J \in \mathcal{C}} J$. Then $U$ is an ideal: if $a, b \in U$, say $a \in J_1$ and $b \in J_2$, then one of $J_1, J_2$ contains the other, so $a - b$ lies in the bigger one, and so does $ra$ for any $r \in R$. Since $1 \notin J$ for every $J \in \mathcal{C}$, $1 \notin U$, so $U$ is proper. So $U \in \mathcal{S}$ is an upper bound for the chain.
By Zorn's Lemma, $\mathcal{S}$ has a maximal element $M$. If $M \subseteq J \subsetneq R$ for an ideal $J$, then $J \supseteq I$, so $J \in \mathcal{S}$ and $J = M$. So $M$ is a maximal ideal containing $I$. $\blacksquare$
The original notes check only chains $I_1 \subseteq I_2 \subseteq \cdots$ indexed by $\mathbb{N}$. Zorn's Lemma needs every chain to have an upper bound, including uncountable ones, so the proof above takes an arbitrary chain. The argument is word-for-word the same; the union just isn't indexed by $n$.
Zorn's Lemma is equivalent to the Axiom of Choice from Functions. Every time you hear "every ring with $1$ has a maximal ideal," Choice is quietly doing the work.
Now the main event: maximal ideals are exactly the ones with field quotients.
Suppose $M$ is an ideal in a commutative ring $R$. Then $M$ is maximal $\iff R/M$ is a field.
Proof. $R/M$ is a field $\iff$ its only ideals are $(0)$ and $R/M$ (and $R/M \neq 0$, i.e. $M \neq R$). By the 4th isomorphism theorem, there is a bijective correspondence between ideals $I$ with $M \subseteq I \subseteq R$ and ideals of $R/M$. So $R/M$ has only two ideals exactly when there are no ideals strictly between $M$ and $R$. $\blacksquare$
In $\mathbb{Z}$, the ideals containing $n\mathbb{Z}$ are the $d\mathbb{Z}$ with $d \mid n$. So $n\mathbb{Z}$ is maximal exactly when nothing fits between $n$ and $1$ in divisibility, which happens exactly when $n$ is prime. Climb the ladder: every ideal is drawn below the ideals containing it.
Fields are the best quotients, but integral domains are the next best. Which ideals give those? Think about what "no zero divisors" means in $R/P$: if $(a + P)(b + P) = 0 + P$, then one of the factors is $0 + P$. Translated back to $R$, that's a definition.
An ideal $P \subsetneq R$ is prime if $P \neq R$ and if whenever $ab \in P$, it must be the case that $a \in P$ or $b \in P$.
The name comes from $\mathbb{Z}$: $p\mathbb{Z}$ is prime exactly when $p \mid ab \Rightarrow p \mid a$ or $p \mid b$, which is Euclid's lemma.
Suppose $P$ is an ideal in a commutative ring $R$. Then $P$ is prime if and only if $R/P$ is an integral domain.
Proof. $R/P$ is commutative with $1 + P$, and $1 + P \neq 0 + P$ exactly when $P \neq R$.
Suppose $P$ is a prime ideal: If $(a+P)(b+P) = P$ then $ab+P = P \implies ab \in P \implies a \in P$ or $b \in P$ ($P$ is a prime ideal) $\implies a+P = P$ or $b+P = P$, so $R/P$ is an integral domain.
Suppose $R/P$ is an integral domain. If $ab \in P$ then $P = ab+P = (a+P)(b+P) \implies a+P = 0$ or $b+P = 0 \implies a \in P$ or $b \in P$. $\blacksquare$
Since every field is an integral domain, the two propositions stack up immediately.
Maximal ideals in commutative rings with identity $1 \neq 0$ are always prime (the converse is not true in general).
Proof. If $M \subset R$ is maximal then $R/M$ is a field $\implies R/M$ is an integral domain $\implies M$ is a prime ideal. $\blacksquare$
$(0)$ is a prime ideal of $\mathbb{Z}$, which means zero is, in some sense, prime. I'm going to need a minute.
$R = \mathbb{Z}$. Find the prime and maximal ideals.
Maximal ideals $= (p)$, $p$ prime. Prime ideals $= \{0\}$ and the maximal ideals.
($\mathbb{Z}/(0) \cong \mathbb{Z}$ is an integral domain but not a field, so $(0)$ is prime but not maximal. $\mathbb{Z}/(n)$ for composite $n$ has zero divisors, so $(n)$ is neither.)
In $\mathbb{Z}$, the only prime ideal that isn't maximal is $(0)$. Polynomial rings have more interesting examples.
$R = \mathbb{Z}[x]$, $I = (x)$. Is $I$ prime? Maximal?
Consider $\phi : R \rightarrow \mathbb{Z}$, $\phi(f) = f(0)$. This is a surjective ring homomorphism, $\ker \phi = I$, so by the 1st isomorphism theorem, $R/I \cong \mathbb{Z}$.
Since $\mathbb{Z}$ is an integral domain, $I$ is a prime ideal. However $\mathbb{Z}$ is not a field, so $I$ is not a maximal ideal.
What maximal ideal is it contained in? Let $\pi : R \rightarrow \mathbb{Z}/2\mathbb{Z}$ be defined by $\pi(f) = \overline{f(0)}$. Then $\pi$ is a surjective ring homomorphism, and $\ker \pi = (2, x)$. By the 1st isomorphism theorem, $R/(2, x) \cong \mathbb{Z}/2\mathbb{Z}$. Since $\mathbb{Z}/2\mathbb{Z}$ is a field, $(2, x)$ is a maximal ideal, which contains $(x)$.
One more fact about $(2, x)$ shows that $\mathbb{Z}[x]$ is a different kind of ring from $\mathbb{Z}$, where every ideal was principal.
A principal ideal domain (PID) is an integral domain in which every ideal is principal.
Show that $J = (2, x)$ is not principal, so $\mathbb{Z}[x]$ is not a PID.
Suppose $J = (f(x)) = \{g(x)f(x) : g(x) \in \mathbb{Z}[x]\}$.
Then $2 \in J \implies \exists g(x) \in \mathbb{Z}[x]$ s.t. $2 = f(x)g(x) \implies \deg f = 0$ (degrees add in the integral domain $\mathbb{Z}$), so $f(x) = m$ for some $m \in \mathbb{Z}$, and $m \mid 2$. So $f = \pm 1$ or $f = \pm 2$.
So $(2, x)$ is not principal, and $\mathbb{Z}[x]$ is not a PID.
PIDs are one rung on a ladder of increasingly nice integral domains: Euclidean domains $\subset$ PIDs $\subset$ UFDs $\subset$ integral domains. $\mathbb{Z}[x]$ just fell off the PID rung, but it will turn out to be a UFD. That's the next page, Integral Domains.
Three to practice the two propositions.
Find all prime ideals and all maximal ideals of $\mathbb{Z}/12\mathbb{Z}$.
By the 4th isomorphism theorem, the ideals of $\mathbb{Z}/12\mathbb{Z}$ are $d\mathbb{Z}/12\mathbb{Z}$ for $d \mid 12$, and by the 3rd, $(\mathbb{Z}/12\mathbb{Z})/(d\mathbb{Z}/12\mathbb{Z}) \cong \mathbb{Z}/d\mathbb{Z}$.
That's a field exactly when $d$ is prime, so the maximal ideals are $(\overline{2})$ and $(\overline{3})$. It's an integral domain exactly when $d$ is prime too (here $d \neq 0$), so the prime ideals are the same two. (Note $(\overline{0})$ is not prime: $\mathbb{Z}/12\mathbb{Z}$ itself has zero divisors.)
Let $R = C([0,1])$ and $M = \{f \in R : f(1/2) = 0\}$. Show that $M$ is a maximal ideal.
On Ring Homomorphisms & Quotient Rings we showed $R/M \cong \mathbb{R}$, using evaluation at $1/2$. $\mathbb{R}$ is a field, so $M$ is maximal.
Prove that in a finite commutative ring with $1 \neq 0$, every prime ideal is maximal.
Proof. If $P$ is prime, then $R/P$ is an integral domain. It's finite, since $R$ is. By the Proposition on Rings & Examples, a finite integral domain is a field. So $R/P$ is a field and $P$ is maximal. $\blacksquare$
Prime ideals behave well under products of ideals, just like prime numbers do under products of numbers.
Let $R$ be a commutative ring, $P$ a prime ideal, and $I, J$ ideals with $IJ \subseteq P$. Prove that $I \subseteq P$ or $J \subseteq P$.
Proof. Suppose $I \not\subseteq P$, and pick $a \in I \setminus P$. Let $b \in J$ be arbitrary. Then $ab \in IJ \subseteq P$. Since $P$ is prime, $a \in P$ or $b \in P$, and $a \notin P$, so $b \in P$. Since $b \in J$ was arbitrary, $J \subseteq P$. $\blacksquare$
(Example: in $\mathbb{Z}$, $(4)(9) = (36) \subseteq (3)$, and indeed $(9) \subseteq (3)$.)