[proofplan]
We reduce to a statement about fields using quotient rings. The inclusion $A \hookrightarrow B$ induces an injection $A/(\mathfrak{q} \cap A) \hookrightarrow B/\mathfrak{q}$, and [Stability Under Quotients and Localisation](/theorems/2867) shows the quotient extension is integral. Since $\mathfrak{q}$ is prime, $B/\mathfrak{q}$ is an integral domain, and $\mathfrak{q} \cap A$ is prime, so $A/(\mathfrak{q} \cap A)$ is an integral domain. The [Integrality and Fields](/theorems/2868) criterion then gives: $A/(\mathfrak{q} \cap A)$ is a field iff $B/\mathfrak{q}$ is a field. Translating back, $\mathfrak{q} \cap A$ is maximal iff $\mathfrak{q}$ is maximal.
[/proofplan]
[step:Construct the injection $A/(\mathfrak{q} \cap A) \hookrightarrow B/\mathfrak{q}$]
Consider the composite ring homomorphism
\begin{align*}
\varphi: A \hookrightarrow B \twoheadrightarrow B/\mathfrak{q},
\end{align*}
where the first map is the inclusion and the second is the canonical surjection. The kernel of $\varphi$ is $\{a \in A : a \in \mathfrak{q}\} = \mathfrak{q} \cap A$. By the first isomorphism theorem for rings, $\varphi$ factors through an injective ring homomorphism
\begin{align*}
\bar{\varphi}: A/(\mathfrak{q} \cap A) \hookrightarrow B/\mathfrak{q}.
\end{align*}
We identify $A/(\mathfrak{q} \cap A)$ with its image $\bar{\varphi}(A/(\mathfrak{q} \cap A)) \subset B/\mathfrak{q}$, viewing $A/(\mathfrak{q} \cap A)$ as a subring of $B/\mathfrak{q}$.
[/step]
[step:Verify that $B/\mathfrak{q}$ is an integral extension of $A/(\mathfrak{q} \cap A)$]
Since $B$ is integral over $A$ and $\mathfrak{q}$ is an ideal of $B$, part (1a) of [Stability Under Quotients and Localisation](/theorems/2867) (applied with $\mathfrak{b} = \mathfrak{q}$) gives that $B/\mathfrak{q}$ is integral over $A/(\mathfrak{q} \cap A)$.
[/step]
[step:Observe both quotients are integral domains and apply the field criterion]
Since $\mathfrak{q}$ is a prime ideal of $B$, the quotient $B/\mathfrak{q}$ is an integral domain. The contraction $\mathfrak{q} \cap A$ is a prime ideal of $A$ (if $xy \in \mathfrak{q} \cap A$ with $x, y \in A$, then $xy \in \mathfrak{q}$, so $x \in \mathfrak{q}$ or $y \in \mathfrak{q}$ by primality, giving $x \in \mathfrak{q} \cap A$ or $y \in \mathfrak{q} \cap A$). Therefore $A/(\mathfrak{q} \cap A)$ is an integral domain.
We now have an integral extension $A/(\mathfrak{q} \cap A) \subset B/\mathfrak{q}$ of integral domains. By part (2) of [Integrality and Fields](/theorems/2868), $A/(\mathfrak{q} \cap A)$ is a field if and only if $B/\mathfrak{q}$ is a field.
[guided]
We have the integral extension $A/(\mathfrak{q} \cap A) \subset B/\mathfrak{q}$ from the previous steps. Both rings are integral domains: $B/\mathfrak{q}$ because $\mathfrak{q}$ is prime, and $A/(\mathfrak{q} \cap A)$ because the contraction of a prime ideal is prime (the preimage of a prime ideal under a ring homomorphism is prime, and $\mathfrak{q} \cap A$ is the preimage of $\mathfrak{q}$ under the inclusion $A \hookrightarrow B$).
Part (2) of [Integrality and Fields](/theorems/2868) applies to integral extensions of integral domains and gives: $B/\mathfrak{q}$ is a field if and only if $A/(\mathfrak{q} \cap A)$ is a field. We verify the hypotheses: $A/(\mathfrak{q} \cap A) \subset B/\mathfrak{q}$ is an integral extension (established in the previous step), and both are integral domains (just verified). The conclusion follows.
[/guided]
[/step]
[step:Translate the field criterion back to maximality of ideals]
For any commutative ring $R$ with identity and any ideal $I \trianglelefteq R$, the ideal $I$ is maximal if and only if $R/I$ is a field. Applying this:
- $\mathfrak{q}$ is a maximal ideal of $B$ if and only if $B/\mathfrak{q}$ is a field.
- $\mathfrak{q} \cap A$ is a maximal ideal of $A$ if and only if $A/(\mathfrak{q} \cap A)$ is a field.
Combining with the equivalence from the previous step:
\begin{align*}
\mathfrak{q} \cap A \text{ is maximal in } A \iff A/(\mathfrak{q} \cap A) \text{ is a field} \iff B/\mathfrak{q} \text{ is a field} \iff \mathfrak{q} \text{ is maximal in } B.
\end{align*}
[/step]