local equation of a divisor, localization and local ring at a point Let $X$ be a regular, proper surface (integral, separated, of fin. type) over a perfect field $k$ and let $Z\subset X$ be an integral irreducible subscheme. Moreover $\eta$ is the generic point of $X$ and $z$ is the generic point of $Z$; it means that $X=\overline{\{\eta\}}$ and $Z=\overline{\{z\}}$. The structure sheaf $\mathcal O_Z$ is determined in a unique way since we have assumed that $Z$ is in particular reduced.
Let $x\in Z$ be a closed point,  since $Z\hookrightarrow X$ is a closed embedding, we have a surjective morphism of local rings $\varphi:\mathcal O_{X,x}\rightarrow \mathcal O_{Z,x}$. Let's denote with $\mathfrak p$ the kernel of $\varphi$ (it is a prime ideal since $Z$ is integral), then $\mathfrak p$ is called "the local equation of $Z$ at $x$".
Here my question: 

What is the relationship between the localiaztion $\left(\mathcal
 O_{X,x}\right)_\mathfrak p$ and the local ring $\mathcal O_{X,z}$?

Intuitively I think that they should be related in some way. Are they isomorphic? 

Remark: Often the ring $\left(\mathcal
 O_{X,x}\right)_\mathfrak p$ is called the localization of $\mathcal O_{X,x}$ at $Z$.
Edit: Note that there is certainly a map $\mathcal O_{X,x}\rightarrow\mathcal O_{X,z}$ (see Liu, 2 remark 4.14). This map is injective... My bet is that if we localize at $\mathfrak p$ we get an isomorphism.

Since any affine open neighbourhood of $x$ in $X$ will contain both $z$ and $\eta$ we can safely assume that $X=\operatorname {Spec}(A)$ is an affine scheme.
The point $z=[\mathfrak q]$ corresponds to some prime ideal $\mathfrak q\subset A$ and the point $x=[\frak m]$ corresponds to some maximal ideal containing $\mathfrak q$ i.e. $\mathfrak q \subset \frak m$.
Your canonical map $\varphi:\mathcal O_{X,x}\rightarrow \mathcal O_{Z,x}$ is none other than the quotient map $$\varphi: A_\mathfrak m\to (A/\mathfrak q)_{\mathfrak m/\mathfrak q}=A_{\frak m}/\mathfrak qA_\mathfrak m .$$Its kernel is thus $$\mathfrak p=\operatorname{ker}(\varphi) =    \mathfrak qA_\mathfrak m             $$ and the localization of $A_\mathfrak m$ at $\mathfrak p=\mathfrak qA_\mathfrak m$ is $(A_\mathfrak m)_{\mathfrak qA_\mathfrak m}=A_\mathfrak q$. 
Conclusion
We have $$ (\mathcal
 O_{X,x})_\mathfrak p=  (A_\mathfrak m)_{\mathfrak qA_\mathfrak m}=A_\mathfrak q=\mathcal O_{X,z} $$ ...and you have won your bet!
