Hartshorne Problem I.3.20 Problem I.3.20 in Hartshorne asks to show that if $Y$ is a variety such that $\dim Y \ge 2$ and $Y$ is normal at a point $P$, then any regular function on $Y-P$ extends to a regular function on $Y$. I am interested in seeing an answer based on the material presented up to chapter I.3. 
 A: Although this is a rather old post, I'd like to post an "answer" on this, if someone like me hopes to solve this exercise with knowledges merely mentioned in Hartshorne Section I.1 to Section I.3. I'm also a new learner in algebraic geometry, so I'm sincerely sorry if there are possible mistakes and misleadings below.
In the posts:

MO 120088, i.e. https://mathoverflow.net/questions/120088/a-question-from-gtm-52-of-hartshone


MSE 1791250, i.e. Regular functions extension to normal points of varieties

There are already wonderful answers and discussions. Here I hope to give details on those posts and trying to be self-contained.
PROOF:
First, we have to rely on the following commutative algebra result:

FACT:[Matsumura, Com. Ring Theory, Thm 11.5] Let $R$ be a normal Noetherian domain. Then we have:
$$
R = \bigcap_{\mathrm{height} \, \mathfrak{p}=1, \, \mathfrak{p} \in \mathrm{Spec}\, R} R_{\mathfrak{p}}.
$$

Now, since $P$ is a normal point on $Y$, the local ring $\mathcal{O}_{P,Y}$ is a normal Noetherian domain, hence we see that
$$
\mathcal{O}_{P,Y} = \bigcap_{\mathrm{height} \, \mathfrak{p}=1, \, \mathfrak{p} \in \mathrm{Spec}\, \mathcal{O}_{P,Y}} (\mathcal{O}_{P,Y})_{\mathfrak{p}}.
$$
We will call the above equation "STARRED". (Sorry, I do not know how to use hyperref here in the post.)
What we will show next is that $f \in (\mathcal{O}_{P,Y})_{\mathfrak{p}}$ for every $\mathfrak{p}$ satisfying $\mathrm{height} \, \mathfrak{p}=1, \, \mathfrak{p} \in \mathrm{Spec}\, \mathcal{O}_{P,Y}$. If so, we obtain that $f \in \mathrm{LHS}$, this is what we desire.
HOWEVER, the above claim is hard to show. First, we can reduce the proof to the case that $Y$ is an affine variety. If $Y$ is not an affine variety, we can choose an affine chart $U$ containing $P$, and the global ring $\mathcal{O}(Y) = \mathcal{O}(U)$, local ring $\mathcal{O}_{S,Y} = \mathcal{O}_{S,U}$ for arbitary point $S \in U$. If one feels this uncomfortable, one may substitude $Y$ into $U$ in the proof below.
Now, we all agree that $Y$ is an affine variety, and then we can simplify the STARRED by using [Hartshorne, Theorem I.3.2]. We obtain
$$
(\mathcal{O}(Y))_{\mathfrak{m}_P} = \bigcap_{\mathrm{height} \, \mathfrak{p}=1, \, \mathfrak{p} \in \mathrm{Spec}\, (\mathcal{O}(Y))_{\mathfrak{m}_P}} ((\mathcal{O}(Y))_{\mathfrak{m}_P})_{\mathfrak{p}}.
$$
Seeing "$\mathfrak{p} \in \mathrm{Spec}\, (\mathcal{O}(Y))_{\mathfrak{m}_P}$", we can immediately use the 1-1 correspondance between the prime ideals in localized ring and the prime ideals contained in $\mathfrak{m}_P$ in $\mathcal{O}(Y)$. Note that such correspondance is also height-preserving, we hence get
$$
(\mathcal{O}(Y))_{\mathfrak{m}_P} = \bigcap_{\mathrm{height} \, \mathfrak{q}=1, \, \mathfrak{q} \in \mathrm{Spec}\, \mathcal{O}(Y), \, \mathfrak{q} \subset \mathfrak{m}_P} \mathcal{O}(Y)_{\mathfrak{q}}.
$$
Now, we interprete the condition on the height geometrically. Note that the height one primes $\mathfrak{q} \subset \mathfrak{m}_P$ are in one-one correspondence with codimension one subvarieties in $Y$ containing $P$. We will denote the corresponding subvariety by $V_{\mathfrak{q}}$. (One may see [Hartshorne exercise I.3.13] for similar arguments.)
With above preperations, we will meet the goal soon. Given any subvariety $V_{\mathfrak{q}}$ containing $P$, since $f$ is regular in $Y-P$, for arbitary $Q \neq P$ contained in $V_{\mathfrak{q}}$, we can find an open set $U_{\mathfrak{q}, Q} \subset V_{\mathfrak{q}}$ containing $Q$, on which $f=g/h$, where $g,h \in \mathcal{O}_Y$.
WARNING: The boldfaced can highly relys on the fact that $\dim Y \geq 2$. This condition is essential! Here is why (BUT you may read it after reading the entire proof): Since $\dim Y \geq 2$, by [Hartshorne, Theorem I.3.2], we have $\dim \mathcal{O}_{Y,P} \geq 2$. Recall that (c.f. [Hartshorne, Theorem I.3.2] again) $\mathcal{O}_{Y,P} = \mathcal{O}(Y)_{\mathfrak{m}_P}$, by comm. algebra, we can show that $\mathrm{height} \, \mathfrak{m}_P \geq 2$. Now since $\mathrm{height}(\mathfrak{q}) = 1$, we finally obtain that $\mathfrak{q} \subsetneq \mathfrak{m}_P$. Hence the word "can" indeed holds.
Let's go back to our proof (if you havent't skipped the above paragraph). Now we claim that $h \not\in \mathfrak{q}$. In fact, otherwise $h(Q)=0$ for all $Q \in V_{\mathfrak{q}}$. Then $f$ would not be regular in $V_{\mathfrak{q}}$.
Hence, we showed that $f \in \mathcal{O}(Y)_{\mathfrak{q}}$. By the simplified STARRED, we finally reach our goal here!
Again sincerely sorry for any possible mistakes and misleading arguments. Thank you all in advance for pointing these out (if any)! :)
