I'm trying to understand the following proof.
Let $f : A \to B$ be a surjective ring homomorphism. If $P$ is a prime ideal of $A$ that contains $\ker f$, then $f(P)$ is a prime ideal in $B$.
Proof: We have $\ker f \subseteq P \subseteq A$. So by the third isomorphism theorem, we have that $P/\ker f$ is an ideal of $A/\ker(f)$. Furthermore, we have that
$$(A/\ker f)/(P/\ker f) \cong A/P.$$
The latter is an integral domain because $P$ is a prime ideal, this proves that $P/\ker f$ is a prime ideal in $A/\ker f$. Furthermore by the first isomorphism theorem you know that because $f$ is surjective,
$$A/\ker f \cong B.$$
It follows that because $P/\ker f$ is a prime ideal in $A/\ker f$ that $f(P)$ is a prime ideal in $B$.
I understand all of the proof except the final line. I'm not sure why $P/\ker f$ being a prime ideal in $A/\ker f$ implies that $f(P)$ is a prime ideal in $B$. I was wondering whether someone can explain why this final implication is true.