Question of Hartshorne book's Proposion II.(2.6)

In Proposition II. (2.6) of Hartshorne book “algebraic geometry“.
I can’t understand proof of part.
In proof, let $V$ be an affine variety over field $k$ with the sheaf of regular function $\mathcal{O}_V$ and affine coordinate ring $A$. Let $X={\rm Spec}A$. Now, define a morphism of locally ringed spaces

$$ \beta : (V, \mathcal{O}_V) \rightarrow X$$

as follows: For each point $p \in V$, $\beta(p)=\mathcal{m}_p$, the maximal ideal corresponding at $p$. And for any open set $U \subseteq X$, define a ring homomorphism $\mathcal{O}_X(U) \rightarrow \beta_*(\mathcal{O}_V(U)=\mathcal{O}_V(\beta^{-1}(U))$.
Givena section $s\in \mathcal{O}_X(U)$, and given a point $p\in \beta^{-1}(U)$, we define $s(p)$ by taking the image of $s$ in the stalk $\mathcal{O}_{X,\beta(p)}$, which is isomorphic to the local ring $A_{\mathcal{m}_p}$, and then passing to the quotient ring $A_{\mathcal{m}_p}/\mathcal{m}_p$ which is isomorphic to the field $k$. Thus, we regard $s$ as a function from $\beta^{-1}(U)$ to $k$.

In book, this homomorphism gives an isomorphism $\mathcal{O}_X(U) \cong \mathcal{O}_V(\beta^{-1}(U))$.

But, I don’t understand this part… why isomorphism??

I want to see Detailed description or reference of this part.

Solutions Collecting From Web of "Question of Hartshorne book's Proposion II.(2.6)"

Let $V$ be an affine variety over an algebraically closed field $k$.
We don’t assume that $V$ is irreducible.
Let $A$ be the affine coordinate ring of $V$.
Let $X = Spec(A)$.
Let $U$ be an open subset of $X$.
Let $s \in \mathcal{O}_X(U)$.
Let $p \in \beta^{-1}(U)$.
We denote by $s(p)$ the image of $s_{m_p}$ in $A_{m_p}/m_pA_{m_p} = k$, where $m_p$ is the maximal ideal corresponding to $p$.
We denote by $\bar s$ the function $\bar s(p) = s(p)$.
If $U = X$, then $A = \mathcal{O}_X(U)$. Since $A_{m_p}/m_pA_{m_p}$ is canonically isomorphic to $A/m_p$, $s(p)$ is the value of $s$ at $p$.
Hence $\bar s = s$ is regular on $V = \beta^{-1}(X)$.
Similarly if $U = D(f)$ for some $f \in A$, then $A_f = \mathcal{O}_X(U)$.
Hence $s = g/f^n$ for some $g \in A$ and an integer $n \ge 0$.
Since $s(p) = g(p)/f(p)^n$, $\bar s$ is regular on $\beta^{-1}(D(f))$.
Hence, $\bar s$ is regular on $\beta^{-1}(U)$ for any open subset $U$.
We define a homomorphism $\psi_U\colon \mathcal{O}_X(U) \rightarrow \mathcal{O}_V(\beta^{-1}(U))$
by $\psi_U(s) = \bar s$.

We claim that $\psi_U$ is an isomorphism.
Suppose $\psi_U(s) = 0$.
Then $\bar s|D(f) = \bar {(s|D(f))} = 0$ for every open subset $D(f) \subset U$.
Suppose $s|D(f) = g/f^n$ for $g \in A$ and an integer $n \ge 0$.
Since $\bar {(s|D(f))} = 0$, $g(p) = 0$ for every $p \in \beta^{-1}(D(f))$.
Hence $f(p)g(p) = 0$ for every $p \in V$.
Hence $fg = 0$.
Hence $s|D(f) = g/f^n = 0$ in $A_f$.
Since $D(f) \subset U$ is arbitrary, $s = 0$.
Hence $\psi_U$ is injective.

It remains to prove that $\psi_U$ is surjective.
We first note that if $U = D(f)$, $\psi_U$ is surjective, hence an isomorphism.
This is clear from the fact that $\mathcal{O}_V(\beta^{-1}(D(f)))$ is canonically isomorphic to $A_f$
(for the proof, see this question).

Let $t \in \mathcal{O}_V(\beta^{-1}(U))$.
Let $(D(f_i))_{i\in I}$ be a cover of $U$.
Let $t_i = t|\beta^{-1}(D(f_i))$.
Since $\psi_{D(f_i)} \colon \mathcal{O}_X(D(f_i)) \rightarrow \mathcal{O}_V(\beta^{-1}(D(f_i)))$ is an isomorphism, there exists $s_i \in \mathcal{O}_X(D(f_i))$ such that $\bar s_i = t_i$.
Since $t_i = t_j$ on $\beta^{-1}(D(f_i)) \cap \beta^{-1}(D(f_j))$, $s_i = s_j$ on $D(f_i) \cap D(f_j)$.
Hence there exists a unique $s \in \mathcal{O}_X(U)$ such that $s|D(f_i) = s_i$.
Since $\bar s |\beta^{-1}(D(f_i)) = \bar s_i = t_i$, $\bar s = t$.
Hence $\psi_U$ is surjective.