TITLE: Prove that the preimage of a prime ideal is also prime.
QUESTION [19 upvotes]: Let $f: R \rightarrow S$ be a ring homomorphism, with $R$ and $S$ commutative and $f(1)=1$. If $P$ is a prime ideal of $S$, show that the preimage $f^{-1}(P)$ is a prime ideal of $R$.

Define $g: S \rightarrow S/P$ with kernel $s$. Let $h = g \circ f: R \rightarrow S/P$. Since $h$ is a ring homomorphism, the kernel is an ideal of $R$. Also, from the first isomorphism theorem, we know that $R/\ker(h) \cong S/P$. Since $P$ is a prime ideal of $S$, we know that $S/P$ is an integral domain. Since $R/\ker(h)$ is isomorphic to $S/P$, it must also be an integral domain, which implies that the kernel of $h$ (which is the preimage of $P$) is a prime ideal of $R$.
Do you think my answer is correct? The reason why I was a bit skeptical of my answer is because I did not use the fact that $R$ and $S$ are commutative. So I'm wondering if I missed something $\dots$
Thank you in advance.

REPLY [2 votes]: Sorry for digging up this old question, but there is a slight mistake in your proof. Your statement $R/\ker(h) \cong S/P$ is wrong; rather, $R/\ker(h) \cong h(R) \subseteq S/P$ where $h(R)$ is a subring of $S/P$. However the proof is saved by noticing that a subring of an integral domain is also an integral domain.