Some questions about Hartshorne chapter 2 proposition 2.6 In Hartshorne chapter 2 proposition 2.6,Hartshorne shows that there is a fully faithful functor $t:\mathcal{Var}\rightarrow \mathcal{Sch}(k)$ from the category of varieties over $k$ to the category of schemes over $k$.He proceed as follows:
First,for any topological space $X$,define $t(X)$ to be the set of irreducible closed subsets of $X$.We can define a topology on $t(X)$ by taking as closed sets the subsets of the form $t(Y)$,where $Y$ is closed subset of $X$.If $f:X_1\rightarrow X_2$ is continuous ,then define a map 
$$t(f):t(X_1)\rightarrow t(X_2)\\ Y\mapsto \overline{f(Y)},$$where $Y$ is a irreducible closed subset of $X_1$. And for any topological space $X$,define $\alpha :X\rightarrow t(X)$ by 
$\alpha(p)=\overline{\{p\}}$.
Question 1:why is $\overline{f(Y)}$ a irreducible closed subset of $X_2$?
Next,let $V$ be an affine variety over $k$ with coordinate ring $A$,and $O_V$ its sheaf of regular functions,he then shows that $(t(V),\alpha_*(O_V))$ is isomorphic to the affine scheme $(X,O_X)$,where $X=\operatorname{Spec}A$.
Question 2:why is $(t(V),\alpha_*(O_V))$ a locally ringed spaces,I mean why is $(\alpha_*(O_V))_Y$ a local ring for any $Y\in t(V)$?
Now define a morphism of locally ringed spaces $\beta:(V,O_V)\rightarrow X=\operatorname{Spec}A,$by $\beta(p)=m_p$.And for any open set $U\subset X$,define a homomorphism of rings $O_X(U)\rightarrow \beta_*(O_V)(U)$:given $s\in O_X(U)$,$p\in \beta^{-1}(U)$,we get a regular function $g$ on $\beta^{-1}(U)$ by $g(p):=\overline{s_{\beta(p)}}\in A_{m_p}/m_p=k$,where $s_{\beta(p)}\in O_{X,\beta(p)}$ and we identify the stalk $O_{X,\beta(p)}$ with the local ring $A_{m_p}$.
Question 3:why is $g$ a regular function?It seems to me that $g$ is locally constant,is this ture? 
Then he claim that the above homomorphism $O_X(U)\rightarrow \beta_*(O_V)(U)$ is a isomorphism and use the fact that there is a 1-1 correspondence $t(V)\leftrightarrow \operatorname{Spec}A=X$,then $(X,O_X)\cong (t(V),\alpha_*(O_V))$ as locally ringed spaces.I can't follow this part of proof.
Question 4:what is this $\beta$ used for?Shouldn't we construct a morphism $(t(V),\alpha_*(O_V))\rightarrow (X,O_X)$?And why $O_X(U)\rightarrow \beta_*(O_V)(U)$ is a isomorphism?
 A: Question 1 is derived exactly as Seth's comment.
Question 2.
We know that 
$$(\alpha_*(O_V))_Y=\varinjlim_{Y\in U}[\alpha_*(O_V)](U)=\varinjlim_{Y\in U}O_V(\alpha^{-1}(U)),$$
now,each open subset of $t(V)$ is of the form $t(V)-t(W)$ for some irreducible closed subset $W$ of $V$,let $U=t(V)-t(W)$ for some $W$ ,then $Y\in U \Leftrightarrow Y\notin t(W)\Leftrightarrow \exists p\in Y,s.t. p\notin W$$\Leftrightarrow Y\cap (V-W)\neq \emptyset$,but $V-W=\alpha^{-1}(U)$,hence $Y\in U \Leftrightarrow Y\cap \alpha^{-1}(U) \neq \emptyset$.And $\alpha$ induce a 1-1 correspondence between open subsets of $V$ and $t(V)$,we have 
$$\varinjlim_{Y\in U}O_V(\alpha^{-1}(U))=\varinjlim_{Y\cap U\neq \emptyset}O_V(U),$$
where $U$ runs over all open subsets of $V$ s.t. $Y\cap U\neq \emptyset.$
Note that $\varinjlim_{Y\cap U\neq \emptyset}O_V(U)$ is just the local ring of a subvariety which has been shown to be a local ring(excercize 3.13 chapter 1).
Question 3.In fact,the function $g$ is defined by the following map:let $p\in \beta^{-1}(U)$,
$$O_X(U)\rightarrow O_{X,\beta(p)}\rightarrow A_{m_p}\rightarrow k\\s\mapsto s(\beta(p))\mapsto \frac{a}{b}\mapsto \frac{a(p)}{b(p)}=g(p),$$
where  $O_{X,\beta(p)}\cong A_{m_p}$ and $a,b\in A,b\notin m_p$.Note that $a,b$ are polynomial functions on $V$ since $A$ is the coordinate ring of $V$ ,and by the definition of $s\in O_X(U)$,for any $p\in \beta^{-1}(U)$,$s(\beta(p))$ is locally quotient of elements in $A$,so $g$ is a regular function on $\beta^{-1}(U)$.Clearly,$g$ is a regular function in the usual sense and need not to be locally constant.
Question 4.Our original plan is to show $(t(V),\alpha_*(O_V))\cong(X,O_X)$.There is a natural homeomorphism $\gamma:t(V)\rightarrow X$,so it's left to show $\gamma':O_X\rightarrow \gamma_*(\alpha_*(O_V))$ is an isomorphism.But $\beta=\gamma\circ\alpha$,so it's enough to show $O_X\cong \beta_*(O_V)$.
We next show that for any open set $U\subset X$,$\varphi:O_X(U)\rightarrow \beta_*(O_V)(U)$ is an isomorphism.
$\varphi$ is injective: suppose $g(p)=0$ for all $p\in\beta^{-1}(U)$.For any $p\in\beta^{-1}(U)$,there exist an open set $p\in W\subset U$ and $a,b\in A,b\notin m_p$ s.t. for any $q\in W$ we have $s(q)=\frac{a}{b}$ and $b\notin q$. 
For any $q\in\beta^{-1}(W),\beta(q)\in W$,we have $s(\beta(q))=\frac{a}{b}$ and $g(q)=\frac{a(q)}{b(q)}=0$.
It follows that $a(q)=0$ for all $q\in\beta^{-1}(W)$,since $\beta^{-1}(W)$ is open and dense in $V$,we see that $a=0$ in $A$.So $s(\beta(q))=0$ for all $\beta(q)\in W$.Since $p$ is a arbitrary piont in $U$,these W can cover U,we see that $s=0$ in $O_X(U)$.
$\varphi$ is surjective:let $g\in O_V(\beta^{-1}(U))$,then for any $p\in\beta^{-1}(U)$,there exist $W\subset \beta^{-1}(U)$,$p\in W$ and $a,b\in A,b\notin \beta(p)=m_p$ such that $g=\frac{a}{b}$ on $W$.Let $s(\beta(q)):=\frac{a}{b}$ for all $q\in W\subset\beta^{-1}(U)$,since $p$ is a arbitrary piont in $\beta^{-1}(U)$ ,these open sets $\beta(W)$ cover $U$,in this way we get $s$ as an element of $O_X(U)$.Then one can check that $s$ is well- defined and  $\varphi(s)=g$.
Alternatively,one can show $O_X\cong \beta_*(O_V)$ by the following diagram:
\begin{matrix}
O_X(U) &\longrightarrow &  \beta_*(O_V)(U)=O_V(\beta^{-1}(U)) \\\
\downarrow  & & \downarrow  \\\
O_{X,p}& \longrightarrow& [\beta_*(O_V)]_p=O_{V,\beta^{-1}(p)} \\\
\downarrow  & & \downarrow  \\\
A_p & \longrightarrow & A_p \\\
\end{matrix} 
