[proofplan]
We show that $\mathfrak{p}_2$ is the contraction of a prime ideal of $B_{\mathfrak{q}_1}$ under the composite $A \to B \to B_{\mathfrak{q}_1}$; the preimage of that prime in $B$ will be the desired $\mathfrak{q}_2 \subset \mathfrak{q}_1$. The core of the argument reduces to showing $(\mathfrak{p}_2 B_{\mathfrak{q}_1}) \cap A \subset \mathfrak{p}_2$. For an element $y/s$ in this intersection (with $y \in \mathfrak{p}_2 B$ and $s \in B \setminus \mathfrak{q}_1$), we use the [Minimal Polynomial Characterisation](/theorems/2879) to obtain minimal polynomials for both $y$ and $s$ over $\operatorname{Frac}(A)$ with controlled coefficients, and a pigeonhole argument on the integrality relation forces $y/s \in \mathfrak{p}_2$.
[/proofplan]
[step:Reduce to showing $(\mathfrak{p}_2 B_{\mathfrak{q}_1}) \cap A \subset \mathfrak{p}_2$]
Let $T := B \setminus \mathfrak{q}_1$, so $B_{\mathfrak{q}_1} = T^{-1}B$. Consider the composite ring homomorphism $\psi: A \hookrightarrow B \to B_{\mathfrak{q}_1}$. If $\mathfrak{p}_2$ equals $\psi^{-1}(\mathfrak{n})$ for some prime $\mathfrak{n} \in \operatorname{Spec}(B_{\mathfrak{q}_1})$, then $\mathfrak{q}_2 := \mathfrak{n} \cap B$ is a prime of $B$ with $\mathfrak{q}_2 \subset \mathfrak{q}_1$ (since primes of $B_{\mathfrak{q}_1}$ correspond to primes of $B$ contained in $\mathfrak{q}_1$) and $\mathfrak{q}_2 \cap A = \mathfrak{p}_2$.
By standard localisation theory, $\mathfrak{p}_2$ is the contraction of a prime of $B_{\mathfrak{q}_1}$ if and only if $\mathfrak{p}_2$ is a contracted ideal, i.e., $\psi^{-1}(\mathfrak{p}_2 B_{\mathfrak{q}_1}) = \mathfrak{p}_2$. The inclusion $\mathfrak{p}_2 \subset (\mathfrak{p}_2 B_{\mathfrak{q}_1}) \cap A$ is automatic (since $\psi(a) = a/1 \in \mathfrak{p}_2 B_{\mathfrak{q}_1}$ for $a \in \mathfrak{p}_2$). So it suffices to show the reverse inclusion:
\begin{align*}
(\mathfrak{p}_2 B_{\mathfrak{q}_1}) \cap A \subset \mathfrak{p}_2.
\end{align*}
[guided]
The strategy is to produce a prime of $B_{\mathfrak{q}_1}$ contracting to $\mathfrak{p}_2$ in $A$. If we can show $\mathfrak{p}_2$ is a contracted ideal under $\psi: A \to B_{\mathfrak{q}_1}$, then $\mathfrak{p}_2 B_{\mathfrak{q}_1}$ is a proper ideal of $B_{\mathfrak{q}_1}$ (since its contraction to $A$ is $\mathfrak{p}_2 \neq A$), and we can find a prime $\mathfrak{n}$ of $B_{\mathfrak{q}_1}$ containing $\mathfrak{p}_2 B_{\mathfrak{q}_1}$ and lying over $\mathfrak{p}_2$. (More precisely, the extension $A_{\mathfrak{p}_2} \subset (B_{\mathfrak{q}_1})_{\mathfrak{p}_2}$ is integral, and [Lying Over](/theorems/2944) applies.)
The contraction condition $(\mathfrak{p}_2 B_{\mathfrak{q}_1}) \cap A = \mathfrak{p}_2$ is automatic in one direction; the content is showing the reverse inclusion $(\mathfrak{p}_2 B_{\mathfrak{q}_1}) \cap A \subset \mathfrak{p}_2$.
[/guided]
[/step]
[step:Take an element $a \in (\mathfrak{p}_2 B_{\mathfrak{q}_1}) \cap A$ and extract its representation]
Let $a \in (\mathfrak{p}_2 B_{\mathfrak{q}_1}) \cap A$. Then $a \in A$ and $a/1 \in \mathfrak{p}_2 B_{\mathfrak{q}_1}$, so there exist $y \in \mathfrak{p}_2 B$ and $s \in T = B \setminus \mathfrak{q}_1$ such that $a/1 = y/s$ in $B_{\mathfrak{q}_1}$. Clearing denominators, there exists $t \in T$ with $t(as - y) = 0$ in $B$. Since $B$ is an integral domain, $as = y$, i.e.,
\begin{align*}
a = \frac{y}{s} \quad \text{in } \operatorname{Frac}(B), \quad y \in \mathfrak{p}_2 B, \quad s \in B \setminus \mathfrak{q}_1.
\end{align*}
If $a = 0$ then $a \in \mathfrak{p}_2$ and we are done. Assume $a \neq 0$, so $y \neq 0$ and $s \neq 0$.
[/step]
[step:Obtain the minimal polynomial of $y$ over $\operatorname{Frac}(A)$ with coefficients in $\mathfrak{p}_2$]
Since $y \in \mathfrak{p}_2 B$ and $B$ is integral over $A$, the element $y$ is integral over $\mathfrak{p}_2$: we can write $y = \sum_{i=1}^m p_i b_i$ with $p_i \in \mathfrak{p}_2$ and $b_i \in B$. Each $b_i$ is integral over $A$, so [Integral Closure of an Ideal as Radical](/theorems/2877) (applied to $A \subset B$ and $\mathfrak{p}_2$) gives $y \in \sqrt{\mathfrak{p}_2 \overline{A}^B}$ where $\overline{A}^B$ is the integral closure of $A$ in $B$. Since $B$ is integral over $A$, we have $\overline{A}^B = B$, so $y \in \sqrt{\mathfrak{p}_2 B}$. In particular, $y$ is $\mathfrak{p}_2$-integral.
Since $A$ is an integrally closed domain, by the [Minimal Polynomial Characterisation](/theorems/2879) applied to $A \subset B$, the ideal $\mathfrak{p}_2$, and the element $y$: the minimal polynomial of $y$ over $K := \operatorname{Frac}(A)$ has the form
\begin{align*}
f_y = T^r + u_1 T^{r-1} + \cdots + u_r \in K[T], \quad u_1, \ldots, u_r \in \sqrt{\mathfrak{p}_2} = \mathfrak{p}_2,
\end{align*}
where the last equality holds because $\mathfrak{p}_2$ is a prime ideal, hence radical. So $f_y(y) = 0$ with all coefficients $u_i \in \mathfrak{p}_2$.
[guided]
We need to control the coefficients of the minimal polynomial of $y$. The element $y$ lies in $\mathfrak{p}_2 B$, and since $B$ is integral over $A$, the set $\mathfrak{p}_2 B$ consists of $\mathfrak{p}_2$-integral elements. More precisely, writing $y = \sum p_i b_i$ with $p_i \in \mathfrak{p}_2$ and $b_i \in B$ integral over $A$: the $\mathfrak{p}_2$-integral elements of $B$ form the set $\sqrt{\mathfrak{p}_2 \overline{A}^B} = \sqrt{\mathfrak{p}_2 B}$ by [Integral Closure of an Ideal as Radical](/theorems/2877) (using $\overline{A}^B = B$ since $B$ is integral over $A$). Since $y \in \mathfrak{p}_2 B \subset \sqrt{\mathfrak{p}_2 B}$, the element $y$ is $\mathfrak{p}_2$-integral.
Now [Minimal Polynomial Characterisation](/theorems/2879) applies because $A$ is integrally closed and $A \subset B$ is an extension of integral domains. The conclusion: the minimal polynomial of $y$ over $K$ has coefficients in $\sqrt{\mathfrak{p}_2}$. Since $\mathfrak{p}_2$ is prime, $\sqrt{\mathfrak{p}_2} = \mathfrak{p}_2$, so all coefficients lie in $\mathfrak{p}_2$.
[/guided]
[/step]
[step:Obtain the minimal polynomial of $s$ over $\operatorname{Frac}(A)$ with coefficients in $A$]
Since $s \in B$ and $B$ is integral over $A$, the element $s$ is integral over $A$. Because $A$ is integrally closed, by [Minimal Polynomial Characterisation](/theorems/2879) applied to $A \subset B$, the ideal $A$ itself, and the element $s$: the minimal polynomial of $s$ over $K$ has coefficients in $\sqrt{A} = A$ (since $A$ is radical in itself). Write
\begin{align*}
f_s = T^d + v_1 T^{d-1} + \cdots + v_d \in K[T], \quad v_1, \ldots, v_d \in A.
\end{align*}
[/step]
[step:Derive the minimal polynomial of $s$ from that of $y$ using $y = as$]
Since $y = as$ with $a \in A \subset K$, the minimal polynomials of $y$ and $s$ over $K$ are related. Define
\begin{align*}
g(T) := a^{-r} f_y(aT) = T^r + a^{-1} u_1 T^{r-1} + \cdots + a^{-r} u_r \in K[T].
\end{align*}
Then $g(s) = a^{-r} f_y(as) = a^{-r} f_y(y) = 0$. Since $g$ is monic of degree $r$ and $f_y$ is the minimal polynomial of $y$, the polynomial $g$ vanishes at $s$ and has degree $r$. The minimal polynomial $f_s$ of $s$ divides $g$ in $K[T]$, so $d \leq r$.
Similarly, define $h(T) := a^d f_s(T/a) = T^d + a v_1 T^{d-1} + \cdots + a^d v_d \in K[T]$. Then $h(y) = a^d f_s(y/a) = a^d f_s(s) = 0$ (using $y = as$). Since $h$ is monic of degree $d$ and vanishes at $y$, the minimal polynomial $f_y$ divides $h$, so $r \leq d$. Combined with $d \leq r$, we get $r = d$ and hence $f_s = g$ (both are monic of the same degree, $f_s \mid g$, and $\deg f_s = \deg g$). Therefore
\begin{align*}
f_s(T) = T^r + a^{-1} u_1 T^{r-1} + a^{-2} u_2 T^{r-2} + \cdots + a^{-r} u_r.
\end{align*}
[guided]
Since $y = as$, the roots of the minimal polynomial of $y$ over $K$ are obtained by multiplying the roots of the minimal polynomial of $s$ over $K$ by $a$. More precisely, if $\alpha$ is a root of $f_y$ then $\alpha/a$ is a root of $g(T) = a^{-r}f_y(aT)$. Since $s = y/a$ is a root of $g$ and $g$ is monic of degree $r = \deg f_y$, the minimal polynomial $f_s$ divides $g$.
The reverse argument: $h(T) = a^d f_s(T/a)$ is a monic polynomial of degree $d$ vanishing at $y = as$. Since $f_y$ is the minimal polynomial of $y$, $f_y \mid h$, giving $r \leq d$. Together $r = d$, so $f_s$ and $g$ are monic of the same degree with $f_s \mid g$, forcing $f_s = g$. The coefficients of $f_s$ are thus $a^{-j} u_j$ for $j = 1, \ldots, r$.
[/guided]
[/step]
[step:Conclude $a \in \mathfrak{p}_2$ by contradiction]
From the previous step, the coefficients of $f_s$ are $a^{-j} u_j$ for $j = 1, \ldots, r$. From the fourth step, these coefficients also lie in $A$: $a^{-j} u_j = v_j \in A$ for each $j$.
Suppose for contradiction that $a \notin \mathfrak{p}_2$. Since $u_j \in \mathfrak{p}_2$ for each $j$, we examine the integrality relation $f_s(s) = 0$:
\begin{align*}
s^r + (a^{-1} u_1) s^{r-1} + \cdots + (a^{-r} u_r) = 0.
\end{align*}
Each coefficient $a^{-j} u_j \in A$. We claim $a^{-j} u_j \in \mathfrak{p}_2$ for each $j$. Indeed, $a^j (a^{-j} u_j) = u_j \in \mathfrak{p}_2$, and since $a \notin \mathfrak{p}_2$ and $\mathfrak{p}_2$ is prime, repeated application of primality gives: $a \cdot (a^{j-1}(a^{-j}u_j)) = u_j \in \mathfrak{p}_2$ with $a \notin \mathfrak{p}_2$, so $a^{j-1}(a^{-j}u_j) \in \mathfrak{p}_2$. Continuing by induction on $j$ (the base case $j = 1$: $a(a^{-1}u_1) = u_1 \in \mathfrak{p}_2$ and $a \notin \mathfrak{p}_2$ gives $a^{-1}u_1 \in \mathfrak{p}_2$; the inductive step is identical), we conclude $a^{-j}u_j \in \mathfrak{p}_2$ for all $j$.
From the relation $s^r = -(a^{-1}u_1 \cdot s^{r-1} + \cdots + a^{-r}u_r)$, every term on the right lies in $\mathfrak{p}_2 B$ (since $a^{-j}u_j \in \mathfrak{p}_2 \subset A$ and $s^{r-j} \in B$). Therefore $s^r \in \mathfrak{p}_2 B \subset \mathfrak{p}_1 B$ (using $\mathfrak{p}_2 \subset \mathfrak{p}_1$). Since $\mathfrak{p}_1 = \mathfrak{q}_1 \cap A$, we have $\mathfrak{p}_1 B \subset \mathfrak{q}_1$, so $s^r \in \mathfrak{q}_1$. Since $\mathfrak{q}_1$ is prime, $s \in \mathfrak{q}_1$, contradicting $s \in B \setminus \mathfrak{q}_1$.
Therefore $a \in \mathfrak{p}_2$, which establishes $(\mathfrak{p}_2 B_{\mathfrak{q}_1}) \cap A \subset \mathfrak{p}_2$.
[guided]
This is the heart of the proof, where both the integral closedness of $A$ and the Going Down structure are consumed.
We know the coefficients of $f_s$ are both $a^{-j}u_j$ (from the relationship $y = as$) and elements of $A$ (from the fourth step). The key assumption for contradiction is $a \notin \mathfrak{p}_2$.
Since $u_j \in \mathfrak{p}_2$ and $a \notin \mathfrak{p}_2$ with $\mathfrak{p}_2$ prime, we can peel off factors of $a$ from the product $a^j \cdot (a^{-j}u_j) = u_j \in \mathfrak{p}_2$. Primality says: if a product lies in $\mathfrak{p}_2$ and one factor does not, then the other must. For $j = 1$: $a \cdot (a^{-1}u_1) = u_1 \in \mathfrak{p}_2$ with $a \notin \mathfrak{p}_2$ gives $a^{-1}u_1 \in \mathfrak{p}_2$. For $j = 2$: $a^2 \cdot (a^{-2}u_2) = u_2 \in \mathfrak{p}_2$; since $a \notin \mathfrak{p}_2$, we get $a \cdot (a^{-2}u_2) \in \mathfrak{p}_2$, and applying primality once more gives $a^{-2}u_2 \in \mathfrak{p}_2$. Continuing inductively handles all $j$.
With all coefficients $a^{-j}u_j \in \mathfrak{p}_2$, the integrality relation $s^r + \sum_j (a^{-j}u_j)s^{r-j} = 0$ shows $s^r \in \mathfrak{p}_2 B$. The chain of inclusions $\mathfrak{p}_2 B \subset \mathfrak{p}_1 B \subset \mathfrak{q}_1$ (the last because $\mathfrak{p}_1 = \mathfrak{q}_1 \cap A$ implies $\mathfrak{p}_1 \subset \mathfrak{q}_1$, hence $\mathfrak{p}_1 B \subset \mathfrak{q}_1 B \subset \mathfrak{q}_1$) puts $s^r \in \mathfrak{q}_1$. Primality of $\mathfrak{q}_1$ forces $s \in \mathfrak{q}_1$, contradicting the choice $s \in B \setminus \mathfrak{q}_1$.
This contradiction shows $a \in \mathfrak{p}_2$, completing the proof that $(\mathfrak{p}_2 B_{\mathfrak{q}_1}) \cap A \subset \mathfrak{p}_2$.
[/guided]
[/step]
[step:Conclude the existence of $\mathfrak{q}_2$]
We have shown $(\mathfrak{p}_2 B_{\mathfrak{q}_1}) \cap A = \mathfrak{p}_2$. In particular, $\mathfrak{p}_2 B_{\mathfrak{q}_1} \neq B_{\mathfrak{q}_1}$ (since its contraction $\mathfrak{p}_2$ is a proper ideal of $A$). By [Lying Over](/theorems/2944) applied to the integral extension $A \hookrightarrow B_{\mathfrak{q}_1}$ (which is integral because $A \subset B$ is integral and localisation preserves integrality by [Stability Under Quotients and Localisation](/theorems/2867)), there exists a prime $\mathfrak{n} \in \operatorname{Spec}(B_{\mathfrak{q}_1})$ with $\mathfrak{n} \cap A = \mathfrak{p}_2$.
Set $\mathfrak{q}_2 := \mathfrak{n} \cap B$. Then $\mathfrak{q}_2 \in \operatorname{Spec}(B)$ and $\mathfrak{q}_2 \subset \mathfrak{q}_1$ (since primes of $B_{\mathfrak{q}_1} = T^{-1}B$ correspond to primes of $B$ contained in $\mathfrak{q}_1$). The contraction satisfies $\mathfrak{q}_2 \cap A = (\mathfrak{n} \cap B) \cap A = \mathfrak{n} \cap A = \mathfrak{p}_2$.
[/step]