This exercise is taken from Falko Lorenz's Algebra, 4.12
Let $R$ be a commutative ring with unity and $S$ a multiplicative subset of $R$. Form the localization $S^{-1}R$ of $R$ relative to S, with canonical map $i:R\rightarrow S^{-1}R$. If $\alpha$ is an ideal of $R$ denote by $S^{-1}$ the ideal of $S^{-1}R$ generated by $i(\alpha)$. It is easy to check that $S^{-1}\alpha$ consists of all elements of the form a/s with $a\in\alpha$ and $s\in S$; moreover $S^{-1}\alpha=(1)$ iff $\alpha\cap S\not=\emptyset$. Conversely, if $\beta$ is an ideal of $S^{-1}R$, denote the ideal $i^{-1}(\beta)$ of $R$ by $\beta\cap R$. Then $\alpha$ is of the form $\alpha=i^{-1}(\beta)$ iff no element of $S$ gives rise to a zero divisor of R/$\alpha$. Prove that the maps $\mathbb{B}\rightarrow\mathbb{B}\cap R$ and $\mathbb{A}\rightarrow S^{-1}\mathbb{A}$ establish a one-to-one correspondence between prime ideals of $S^{-1}R$ and prime ideals of $R$ that are disjoint from $S$.