Let $A, B$ be commutative rings, $f\colon A\to B$ be a ring homomorphism and $\mathfrak{p} \in \rm{Spec}A$. Consider a ring $C= B\otimes_A \kappa(\mathfrak{p})$ and the canonical map $B\to C$, where $\kappa(\mathfrak{p}) = A_\mathfrak{p}/\mathfrak{p}A_\mathfrak{p}$ is a residue field of $\mathfrak{p}$. Is it true that $$C_\mathfrak{r} = B_\mathfrak{q}\otimes_A \kappa(\mathfrak{p})$$ for arbitrary $\mathfrak{r} \in \rm{Spec} C$ and $\mathfrak{q} = \mathfrak{r} \cap B$ ?
This equation is written on Matsumura's book, Commutative Algebra (Japanese version). I tried to prove this by constructing the canonical isomorphism between the two. Since the tensor product of rings is pushout in the category of rings, existence of the map $B_\mathfrak{q}\otimes_A \kappa(\mathfrak{p}) \to C_\mathfrak{r}$ is easy. I tried to make the map $C_\mathfrak{r} \to B_\mathfrak{q}\otimes_A \kappa(\mathfrak{p})$ from the universal property of localization, but I couldn't prove the elements of $C\setminus \mathfrak{r}$ are invertible in $ B_\mathfrak{q}\otimes_A \kappa(\mathfrak{p})$.
Welcome to MSE.
Let $ x=\sum (b_i\otimes [\frac{a_i}{r_i}])\not\in $. We Assume that $\tilde x=\sum (\frac{b_i}{1}\otimes [\frac{a_i}{r_i}])$ is not invertible in ⊗() and reach a contradiction.
Put $r = \prod r_i \in A\setminus p\ ,\ r'_i=\prod_{j\not=i}r_j $ then: $$(1\otimes [\frac{r}{1}])\tilde x= (\sum \frac{f(a_ir_i')b_i}{1}\otimes [\frac{1}{1}])$$ Is not invertible in ⊗() as well (here we use commutativity).
Therefore $\sum f(a_ir_i')b_i\in q$ which implies $(\sum f(a_ir_i')b_i\otimes [\frac{1}{1}])\in $ but then: $$x=(1\otimes [\frac{1}{r}])(\sum f(a_ir_i')b_i\otimes [\frac{1}{1}])\in $$ contradiction.