Localization preserves UFDs using Kaplansky criterion 
I want to show that if $A$ is an UFD then $S^{-1}A$ is also a UFD using the Kaplansky criterion.

So what I have so far is this:
Let $I$ be a nonzero prime ideal in $S^{-1}A$. Then $I=JS^{-1}A$ where $J$ is a non zero prime ideal of $A$. Since $A$ is an UFD, $J$ contains a prime element $x$.
How can I conclude that $I$ contains a prime element? Am I right so far?   
 A: Your idea is right. If $\mathscr{P}$ is a prime ideal of $S^{-1}A$, then by the correspondence between prime ideals of $A$ and $S^{-1}A$ we have that $\mathscr{P}=P^e$, for an unique prime ideal $P$ of $A$ such that $P\cap S=\emptyset$.
Now, since $A$ is an UFD, by Kaplanky's criterion we have that there is some prime $p\in P$, then $p/1\in \mathscr{P}$. So it only remains to prove that $p/1$ is prime in $S^{-1}A$.
Let's suppose that $p/1\mid \alpha \beta$, for some $\alpha, \beta\in S^{-1}A$. Thus there is $\gamma\in S^{-1}A$ such that $\alpha \beta=p\gamma$. If we write $\alpha=a/s$, $\beta=b/t$ and $\gamma=c/u$, where $s,t,u\in S$, we deduce that $$\frac{ab}{st}=\frac{pc}{u}.$$
Then there is some $v\in S$ such that $(abu-pcst)v=0$, which gives us $abu=pcst$, thus $p\mid abu$, so because $p$ is prime we deduce that either $p\mid a$, $p\mid b$ or $p\mid u$. But if $p\mid u$, we can write $u=pu'\in P$, so $u\in P\cap S$, contradiction.
Therefore, either $p\mid a$ or $p\mid b$. If $p\mid a$, let's write $a=pa'$, then $a/s=p/1\cdot a'/s$, i.e. $p/1\mid \alpha$. If $p\mid b$ we analogously deduce that $p/1\mid \beta$. Hence, $p/1$ is prime.
