How to show that $\operatorname{Spec}(S^{-1}A)=\operatorname{Spec}(O_{X, p})=\cap_{s\not\in p}\operatorname{Spec}(A_s)$? Let $X=\operatorname{Spec}(A)$ be an affine scheme, $p \in X$ a prime ideal, $S=\{s \in A \mid s \not\in p\}$. $O_{X}$ is the structure sheaf of $X$ and $O_{X, p}$ is the stalk of $O_X$ at $p$. 

How to show that $$\operatorname{Spec}(S^{-1}A)=\operatorname{Spec}(O_{X, p})=\cap_{s\not\in p} \operatorname{Spec}(A_s)?$$

I think that $\operatorname{Spec}(S^{-1}A)=\operatorname{Spec}(O_{X, p})$ follows from the fact that $S^{-1}A=O_{X,p}$.
If $q \in \cap_{s\not\in p} \operatorname{Spec}(A_s)$, then for each $s \in S$, $q \in \operatorname{Spec}(A_s)$. Therefore $q$ is a prime ideal of $A_s$ which corresponds to a prime ideal of $A$ such that $s \not\in q$ for any $s \in S$. Therefore $q \in \operatorname{Spec}(S^{-1}A)$. The converse is proved similarly. Is this true? Thank you very much.
 A: Notice that in this setting we have $\mathcal{O}_X = A$. So the first identity holds and, as you said, it follows from $S^{-1}A = A_p$.
However the second identity is not correct and there's a mistake in your argument: you say

If $q \in \cap_{s\not\in p} \operatorname{Spec}(A_s)$, then for each $s \in S$, $q \in \operatorname{Spec}(A_s)$. Therefore $q$ is a prime ideal of $A_s$ which corresponds to a prime ideal of $A$ such that $s \not\in q$ for any $s \in S$. Therefore $q \in \operatorname{Spec}(S^{-1}A)$.

The mistake is that $q \in \operatorname{Spec}(A_s)$ implies $q\subset s$ which is  not equivalent to your $s\not \in q$. And $q\subset s$ implies that $q \not\in \operatorname{Spec}(S^{-1}A)$, because $q$ is invertible in $S^{-1}A$ being a multiple of $s\in S$.
Notice that $A_s$ is a local ring, where everything but $(s)$ is invertible, so if $q$ is a prime ideal of $A_s$ it needs to be a multiple of $s$, or equivalently $q\subset s$.
This notation can be confusing and maybe this is where your confusion arises. Keep in mind that $p^{-1}A$ and $A_p$ are not the same thing, at all! What is true is $(A\setminus p)^{-1}A = A_p$
