Localizing a localization at a prime ideal When I did some reading on localization, I stumbled upon a thought which I'm not able to prove. This might be right or wrong in a trivial fashion, but I'm stuck nonetheless.
Let A be an integral domain and suppose $S \subset A$ is multiplicatively closed, but $S^{-1} A \neq Q(A)$. Thus there exists $P \in Spec(A)$ so that $S^{-1}P$ is a prime ideal in $S^{-1}A$, and consequently, we may look at the localization $S^{-1}A_{S^{-1}P}$. Does $S^{-1}A_{S^{-1}P} \cong A_P$ hold, and if yes, how can I prove it?
 A: Yes, $S^{-1}A_{S^{-1}P} \cong A_P$ holds. Here is why.   
Put  $T=A\setminus P$. Your hypothesis that $P $ survives in $S^{-1}A$ amounts to $P\cap S=\emptyset$, or equivalently that $S\subset T$.
But then inverting first elements of $S$, obtaining $S^{-1} A$ and then inverting the image of $T$  obtaining $(S^{-1}A)_{S^{-1}P} $ amounts to the same as directly inverting all of $T$ in one fell swoop, obtaining $A_P$.
You can find the details  in Bourbaki, Commutative algebra, chap.II , §2,  Prop.7.
A: A localization of a localization is itself a localization. Essentially for the same reason that a fraction of fractions is just a fraction.
Proposition. Let $A$ be a commutative ring with $1$; let $S$ be a multiplicative subset of $A$, and let $R=S^{-1}A$ be the localization of $A$ at $S$. Let $T$ be a nonempty multiplicative subset of $R$, and let $U\subseteq A$ be the set
$$U = \left\{ u\in A\ \left|\  \exists s\in S\text{ such that }\frac{u}{s}\in T\right\}\right..$$
Then $U$ is a multiplicative subset of $A$, and 
$$\frac{(r/s')}{(u/s)} \longmapsto \frac{rs}{us'}$$
is an isomorphism $T^{-1}R\to U^{-1}A$.
I'll give two proofs: a "pedestrian" one and a fancy one.
Proof the Pedestrian. First, we prove that $U$ is a multiplicative subset of $A$: if $u,u'\in A$, then there exist $s,s'\in S$ such that $\frac{u}{s},\frac{u'}{s'}\in T$. Since $T$ is multiplicative, $\frac{uu'}{ss'}\in T$, hence $uu'\in U$. So $U$ is multiplicative.
Second, if $u\in U$ and $s'\in S$, then $us'\in U$; that is, $U$ absorbs multiplication by elements of $S$: for there exists $s\in S$ such that $\frac{u}{s}\in T$. Then, since $\frac{us'}{ss'} = \frac{u}{s}$, and $ss'\in S$, then $us'\in T$, as claimed.
Therefore, $\frac{rs}{us'}$ makes sense as an element of $U^{-1}A$.
Next, we show that the map is well-defined. If 
$$\frac{r/s'}{u/s} = \frac{\rho/\sigma'}{\vartheta/\sigma}$$
in $T^{-1}R$, then there exists $\frac{x}{y}\in T$ such that
$$\frac{x}{y}\left(\frac{r\vartheta}{s'\sigma} - \frac{u\rho}{s\sigma'} \right)= 0_R,$$
which is equivalent to
$$\frac{x(r\vartheta s\sigma' - u\rho s'\sigma)}{yss'\sigma\sigma'} = 0_R,$$
which in turn is equivalent to saying that there exists $z\in S$ such that
$$zx(r\vartheta s\sigma' - u\rho s'\sigma) = 0_A.$$
But since $\frac{x}{y}\in T$, then $x\in U$; and since $z\in S$, then $zx\in U$. Therefore, the equation written above implies that in $U^{-1}A$ we have
$$\frac{rs}{us'} = \frac{\rho \sigma}{\vartheta\sigma'},$$
which is exactly what wee need for the map to be well defined.
Showing that the map is a homomorphism is now easy, just as doing fraction arithmetic. We have:
$$\begin{align*}
\frac{r/s'}{u/s} + \frac{x/y}{z/w} &= \frac{\frac{rz}{s'w} + \frac{xu}{ys}}{\frac{uz}{sw}}\\
&= \frac{\quad\frac{rzys + xus'w}{s'wys}}{\frac{uz}{sw}}\\
&\longmapsto \frac{(rzys + xus'w)(sw)}{uzs'wys} = \frac{rzys + xus'w}{uzs'y}.\\
\frac{rs}{s'u} + \frac{xw}{yz} &= \frac{rsyz + xws'u}{s'uyz}.\\
\frac{r/s'}{u/s} \times \frac{x/y}{z/w} &= \frac{\quad \frac{rx}{s'y}\quad}{\frac{uz}{sw}}\\
&\longmapsto \frac{rxsw}{s'yuz}.\\
\frac{rs}{s'u}\times \frac{xw}{yz} &= \frac{rsxw}{s'uyz}.
\end{align*}$$
Now assume that $\frac{r/s'}{u/s}$ maps to $0$. That means that $\frac{rs}{us'} = 0_{U^{-1}A}$, so there exists $\vartheta\in U$ such that $\vartheta(rs)=0$. But then there exists $s''\in S$ such that $\frac{\vartheta}{s''}\in T$, and $$\frac{\vartheta}{s''}\cdot\frac{r}{s'} = \frac{\vartheta r}{s''s} = 0_{R}$$
because $s\in S$ and $s(\vartheta r) = 0$. So the map is one-to-one.
Finally, given $\frac{a}{u}\in U^{-1}A$, there exists $s\in S$ such that $\frac{u}{s}\in T$; then $\frac{a/s}{u/s}\mapsto \frac{as}{us} = \frac{a}{u}$, so the map is onto. Thus, we have an isomorphism. $\Box$
The proposition can also be proven by invoking the Universal Property of the Localization: if $S$ is a multiplicative subset of $A$ and $\psi\colon A\to S^{-1}A$ is the canonical map, then for every commutative ring $R$ and every ring homomorphism $\varphi\colon A \to R$ such that $\varphi(s)$ is a unit in $R$ for every $s\in S$, there exists a unique $\Phi\colon S^{-1}A\to R$ such that $\varphi=\Phi\circ\psi$. 
The map $\Phi$ is necessarily given by $\Phi(\frac{a}{s}) = \varphi(a)\varphi(s)^{-1}$. 
Proof the Fancy. Let $A$, $S$, $R$, $T$, and $U$ be as in the statement of the proposition, let $\varphi\colon A\to R$ be the canonical map, $\varphi(a) = \frac{as_0}{s_0}$ (for some fixed $s_0\in S$, say); and $\psi\colon A\to U^{-1}A$ be the canonical map $\psi(a)=\frac{au_0}{u_0}$. Let $\theta\colon R\to T^{-1}R$ be the canonical map, $\theta(r)=\frac{rt_0}{t_0}$. Write $t_0 = \frac{\rho_0}{\sigma_0}$. 
First, we would prove, as above, that $U$ is a multiplicative subset and absorbs multiplication by elements of $S$.
Now consider the composition $A\to S^{-1}A\to T^{-1}R$. If $u\in U$, then there exists $s\in S$ such that $\frac{u}{s}\in T$; then $\frac{u}{s}$ is mapped to a unit in $T^{-1}R$; but $s$ is mapped to a unit in $S^{-1}A$, so $\frac{ss}{s}\in S^{-1}A$ is mapped to a unit in $T^{-1}R$. Thus, the product $\frac{uss}{ss}$ is mapped to a unit, but this is the image of $u$ in $T^{-1}R$. Hence the compositum $A\to S^{-1}A\to T^{-1}R$ maps every $u\in U$ to a unit, so the map factors through $U^{-1}A$; this gives the map $\Psi\colon U^{-1}A\to T^{-1}R$. 
Now map $S^{-1}A$ to $U^{-1}A$ by selecting $u\in U$ and sending $\frac{a}{s}$ to $\frac{au}{su}\in U^{-1}A$. If $\frac{t}{s'}\in T$, then $\frac{tu}{s'u}$ is a unit in $U^{-1}A$, since $tu\in U$. Thus, the map factors through $T^{-1}(S^{-1}A) = T^{-1}R$, giving a map $T^{-1}R\to U^{-1}A$.  Now just verify that the compositions of the maps $T^{-1}R\to U^{-1}A\to T^{-1}R$ and $U^{-1}A\to T^{-1}R\to U^{-1}A$ are the identity. $\Box$

Now, looking at your special case, note that $U$ consists precisely of all the "numerators" in $S^{-1}P$, and it is easy to see that they are precisely the elements of $P$. 
A: Well, there is a one-to-one correspondence between prime ideals of $S^{-1}A$ and prime ideals of $A$ that have an empty intersection with $S$, via the mapping $P\mapsto S^{-1}P$.
So, let $S^{-1}P\in Spec(S^{-1}A)$ for some $P\in Spec(A)$ with $P\cap S=\emptyset$.  Consider the mapping $f:S^{-1}A_{S^{-1}P}\rightarrow A_P$ given by:
$f\left(\frac{a_1}{s_1}/(\frac{a_2}{s_2})\right)=\frac{a_1 s_2}{s_1 a_2}$.  
Note that in $\frac{a_1}{s_1}/(\frac{a_2}{s_2})\in S^{-1}A_{S^{-1}P}$, we have $s_i\in S$, $a_1\in A$, and $a_2\in A\setminus P$.  Thus, $s_1a_2\notin P$ (since neither of $s_1$ or $a_2\in P$) and, obviously, $a_1 s_2\in A$.  Thus, $f$ really does take elements to $A_P$.  I'll let you show that $f$ is, in fact a homomorphism.
Given $\frac{a}{s}\in A_P$, $f\left(\frac{a}{s}/(\frac{1}{1})\right)=\frac{a}{s}$, so  $f$ is onto.  Finally, if $f\left(\frac{a_1}{s_1}/(\frac{a_2}{s_2})\right)=0$, then $\frac{a_1s_2}{a_2s_1}=\frac{0}{1}$, implying that $a_1s_2=0$, and hence $a_1=0$.  From that, it follows that, in $S^{-1}A_{S^{-1}P}$, $\frac{a_1}{s_1}/(\frac{a_2}{s_2})=0$, and thus $f$ is injective.  
Therefore, $S^{-1}A_{S^{-1}P}\cong A_P$.
