Intuition of local ring $O_{p,X},p\in X$ prime ideals correspondence with subvarieties of variety $X$ What is the intuition of local ring $\mathcal{O}_{p,X}$ for $p\in X$ prime ideal correspondence with subvarieties of variety $X$? 
I am using Hartshorne's definition of variety here. I knew $\mathcal{O}_{p,X}\cong A(\bar{X})_{m_p}$ where $m_p$ is the maximal ideal of $p\in X$ and $\bar{X}$ is the closure of $X$ in either $\mathbb{P}^n$ or $\mathbb{A}^n$. I knew there is correspondence as posteriori fact after showing the isomorphism. Suppose I do not know $A(\bar{X})_{m_p}$. 


*

*What is the geometric intuition on $\mathcal{O}_{p,X}$ prime ideals corresponding to subvarieties of variety $X$ here? 

*Since $\mathcal{O}_{p,X}$ is a local ring and it basically looks at the set away from $p$, is this looking at the regular functions on subvarieties containing $p$ as obvious I have $\mathcal{O}_{p,X}\to \mathcal{O}_{p,X'}$ where $X'$ is some subvariety of $X$?
 A: 2) As Mariano says in the comments, you've got it backwards in your second question.  The ideal $m_p$ consists of the regular functions that vanish at $p$.  By localizing at the set $S := A(X) \setminus m_p$, we obtain the collection of functions
$$
\left\{f/g \in k(X) : g \notin m_p \right\} = \left\{f/g \in k(X) : g(p) \neq 0 \right\}
$$
where $k(X)$ is the field of rational functions of $X$.  This means that $g$ does not vanish at $p$, so the above set is the collection of rational functions that are regular (i.e., defined) at $p$.  Thus we have "zoomed in" on $p$ by expanding our view from globally regular functions to those that are only guaranteed to be regular at $p$.
1) By the correspondence theorem for prime ideals in a localization, the only primes $\mathfrak{p}$ that survive in $A(X)_{m_p}$ are those with $\mathfrak{p} \subseteq m_p$.  By contravariance, then $Z(\mathfrak{p}) \supseteq Z(m_p) = \{p\}$, so $Z(\mathfrak{p})$ is an irreducible variety containing the point $p$.
Take for example $X = \mathbb{A}^2 = \operatorname{Spec}(k[x,y])$, $p = (0,0)$, so $m_p = (x,y)$.  The localization $A = k[x,y]_{m_p}$ is local with maximal ideal which (abusing notation slightly) is just $(x,y)$.  We have for example, $(y - x^2) \subseteq (x,y)$, which corresponds to the fact that the point $(0,0)$ lies on the parabola $y - x^2$.
