Corollary 2.20 - Qing Liu Can anyone explain me where the author uses the injectivity of $f$?


 A: I believe you need $f$ to be injective because otherwise $B\otimes_A\operatorname{Frac}(A)$ is the zero ring, and the zero ring has no maximal ideals. To see this, suppose that $f(a) = 0$. Then
$$
1\otimes 1 = 1\otimes \frac{a}{a} = (a\cdot1)\otimes\frac{1}{a} = f(a)\otimes\frac{1}{a} = 0.
$$
Proof steps, with justifications:
Claim: If $f : A\to B$ is a faithfully flat ring homomorphism, then for every prime ideal $\mathfrak{p}\subseteq A$, there exists a prime ideal $\mathfrak{q}\subseteq B$ such that $f^{-1}(\mathfrak{q}) = \mathfrak{p}$.
Proof: $A\to B$ faithfully flat implies that $A/\mathfrak{p}\to B/f(\mathfrak{p})B$ is also faithfully flat.

This follows from the claim that if $B$ is faithfully flat over $A$ and $C$ is an $A$-algebra ($g : A\to C$), then $B\otimes_{A} C$ is faithfully flat over $C$, taking $C = A/\mathfrak{p}$. Indeed: let $B/A$ be faithfully flat, and let $M$ be a $C$-module such that $M\otimes_C\left(B\otimes_{A} C\right)\cong 0$. Then basic properties of tensor products tell us that $$0\cong M\otimes_C\left(B\otimes_{A} C\right)\cong M\otimes_C\left(C\otimes_{A} B\right)\cong \left(M\otimes_C C\right)\otimes_{A} B,$$ and since $B$ is faithfully flat over $A$, $M\otimes_C C\cong 0$. However, $M\otimes_C C$ is naturally isomorphic to $M$ via $m\mapsto m\otimes 1$, so this shows that $M\cong 0$, as desired. No injectivity of $f$ needed.

WLOG take $\mathfrak{p} = (0)$ and $A$ an integral domain.

If we can find a prime $\mathfrak{q}\subseteq B$ satisfying the requirements in this case, we will be done. Indeed, This follows from the fact that $A/\mathfrak{p}$ is an integral domain and there is a commutative square $\require{AMScd}\begin{CD}A @>{f}>> B;\\@VVV @VVV \\A/\mathfrak{p} @>{\overline{f}}>> B/\mathfrak{p}B,\end{CD}$ and if $\mathfrak{q}\subseteq B/\mathfrak{p}B$ is a prime ideal pulling back to $0$ in $A/\mathfrak{p}$, then commutativity means $\mathfrak{q}$ pulls back to a prime $\tilde{\mathfrak{q}}$ in $B$ which pulls back to $\mathfrak{p}$. No injectivity of $f$ needed. However, we do need to assume that $A$ has some prime ideal, which follows from some form of the axiom of choice, provided that $A$ is not the zero ring. If $A$ is the zero ring, the claim is vacuously true, so suppose $A\neq \{0\}$ throughout the rest of the argument.

Let
\begin{align*}
\rho : B&\to B\otimes_A\operatorname{Frac}(A)\\
b&\mapsto b\otimes 1
\end{align*}
be the canonical map.

This map always exists (I just wrote it down in general). No injectivity of $f$ needed.

Let $\mathfrak{m}\subseteq B\otimes_A\operatorname{Frac}(A)$ be a maximal ideal.

Every nonzero ring has a maximal ideal (assuming some form of the axiom of choice). We must verify that $B\otimes_A\operatorname{Frac}(A)$ is not the zero ring. As noted above, this follows from injectivity of $f$. However, this also follows from the faithful flatness of $B/A$: if $B\otimes_A\operatorname{Frac}(A)$ is the zero ring, faithful flatness of $B/A$ implies that $\operatorname{Frac}(A)$ is $0$ as an $A$-module, which is impossible ($0$ is not a field, and $\operatorname{Frac}(A)$ is by construction a field for an integral domain $A$). So technically, you can also complete this step without noting that $f$ is injective.

$\mathfrak{q} = \rho^{-1}(\mathfrak{m})$ is a prime ideal of $B$.

If $\phi : R\to S$ is a ring homomorphism and $\mathfrak{a}\subseteq S$ is prime, so is $\phi^{-1}(\mathfrak{a})$. This is a standard fact about ring homomorphisms, no injectivity needed.

Since $\rho\circ f : A\to B\otimes_A\operatorname{Frac}(A)$ factorizes into $A\xrightarrow{\iota}\operatorname{Frac}(A)\xrightarrow{\psi} B\otimes_A\operatorname{Frac}(A)$,

We need to check that the relevant diagram commutes.\begin{align*}\rho\circ f(a) &= \rho(f(a))\\ &= f(a)\otimes 1\\ &= (a\cdot 1)\otimes 1\\&= 1\otimes\frac{a}{1}\\ &= \psi\left(\frac{a}{1}\right)\\&= \psi(\iota(a)),\end{align*} which is exactly what we want. No injectivity of $f$ needed.

and the inverse image of $\mathfrak{m}$ in $\operatorname{Frac}(A)$ is zero, we have $f^{-1}(\mathfrak{q}) = (\rho\circ f)^{-1}(\mathfrak{m}) = (0)$.

The inverse image of $\mathfrak{m}$ under $\psi$ is $(0)$ since $\psi^{-1}(\mathfrak{m})$ must be a prime ideal, and the only prime ideal of $\operatorname{Frac}(A)$ is $(0)$. Then, since $\rho\circ f = \psi\circ\iota$, it follows that $f^{-1}(\mathfrak{q}) = f^{-1}(\rho^{-1}(\mathfrak{m})) = (\rho\circ f)^{-1}(\mathfrak{m}) = (\psi\circ\iota)^{-1}(\mathfrak{m}) = \iota^{-1}(\psi^{-1}(\mathfrak{m})) = \iota^{-1}((0)) = (0)$. No injectivity of $f$ needed.

This completes the proof, and you can check the details I've provided that the only time $f$ would have been used is in the (implicit) claim that $B\otimes_A\operatorname{Frac}(A)$ is not the zero ring, and therefore has a maximal ideal.
