Let $A$ be a commutative ring, $S$ a multiplicatively closed subset. Let $S^{-1}A$ denote the localization. I want to show that for $\mathfrak{p}$ a prime ideal, $\varphi: A\rightarrow S^{-1}A$, the ideal generated by $\varphi(\varphi^{-1}(\mathfrak{p}))$ is indeed equal to $\mathfrak{p}$.
Denote by $q$ the ideal generated by $\varphi(\varphi^{-1}(\mathfrak{p}))$. We want to show that $q\subset p$ and that $p\subset q$.
We know $\varphi: A\rightarrow S^{-1}A$ sends $a$ to $a/1$. So $\varphi^{-1}(a/s)=a$ assuming $a$ and $s$ are coprime. So if $a/s$ is in $\mathfrak{p}$ we have that $a/1\in \varphi(\varphi^{-1}(\mathfrak{p}))$, and hence $1/s\cdot a/1\in \mathfrak{q}$.
For the other direction. If $b/q$ is in $\mathfrak{q}$ then $b/q=a'/q\cdot a/1$ where $a'/q$ is in $S^{-1}A$ and $a/p$ is in $\mathfrak{p}$ for some $p$. I don't see how to conclude that $b/q$ is in $\mathfrak{p}$. For example if $S=\{1,2,3\}$ and $\mathfrak{p}$ consisted of $a/(2^{1+n}3^{m})$ then $a/3$ would not be in $\mathfrak{p}$ but $a/p$ would be for some $p$.