Hartshorne Exercise I.5.13: subset of nonnormal points is proper and closed I'm trying to solve the following exercise, Exercise I.5.13 from Hartshorne's Algebraic Geometry:

Here's my attempt:
I've been able to show that the set of nonnormal points is a subset of a proper closed subset as follows. By intersecting with an affine open, we may assume that the variety in consideration, say $Y$, is an affine variety. Let $A(Y)$ coordinate ring of $Y$, $\overline{A(Y)}$ its closure in $K(Y)$, the field of fractions of $A(Y)$. By Finiteness of Integral Closure, we obtain that $\overline{A(Y)}$ is generated by some finite number of $f_i/g_i\in K(Y)$ (for $i\in \{1,\ldots, n\}$), over $A(Y)$ as an $A(Y)$-module. Since localization preserves integral closure, $\overline{A(Y)}_{g_1\ldots g_n}$ is integrally closed. But it's easy to see that $\overline{A(Y)}_{g_1\ldots g_n}\cong A(Y)_{g_1\ldots g_n}$, as subrings of $K(Y)$. Thus, the distinguished open set $D(g_1\ldots g_n)\cap Y$ with coordinate ring isomorphic to $A(Y)_{g_1\ldots g_n}$ is normal, by Exercise I.3.17 (d), which states that an affine variety is normal if and only if its coordinate ring is integrally closed.
However, I seem to be unable to prove that the set of nonnormal points is closed too. I would be really grateful if someone could provide a hint on how to finish the proof.
Thank you.
 A: Let $\mathfrak{m}\subset A(Y)$ be the maximal ideal corresponding to a point $y\in Y$, and let $\mathfrak{n}\subset\overline{A(Y)}$ be a maximal ideal containing $\mathfrak{m}\overline{A(Y)}$ corresponding to some point $y'\in \overline{Y}$ mapping to $y$. We get a series of inclusions of rings $$\mathcal{O}_{Y,y} = A(Y)_{\mathfrak{m}} \subset \overline{A(Y)}_{\mathfrak{m}} \subset \overline{A(Y)}_{\mathfrak{n}} = \mathcal{O}_{\overline{Y},y'}.$$
Since integral closure commutes with localization, if $A(Y)_\mathfrak{m}$ is integrally closed, then $\overline{A(Y)}_{\mathfrak{m}} = \overline{A(Y)_{\mathfrak{m}}}$ is already integrally closed and $\mathfrak{m}=\mathfrak{n}$, so all of the inclusions are actually equalities.
If the first inclusion is strict, then $A(Y)_\mathfrak{m}$ is not integrally closed and $y$ is a non-normal point, so $y$ is a normal point exactly when $A(Y)_\mathfrak{m}=\overline{A(Y)}_\mathfrak{m}$. Since $\overline{A(Y)}=A[f_i/g_i]$, this inclusion is an equality iff all the $f_i/g_i$ are in $\mathcal{O}_{Y,y}$.
Now our goal is to show that the set of $y$ so that any of the $f_i/g_i$ are not in $\mathcal{O}_{Y,y}$ is closed. Since there are finitely many $f_i/g_i$, it suffices to show that for a rational function $h\in K$ the set of $y\in Y$ so that $h\notin \mathcal{O}_{Y,y}$ is closed. Let $I(h)$ be the ideal of $A$ given by $\{a\in A(Y) \mid ah\in A(Y)\}$: this is known as the ideal of denominators of $h$. I claim that the vanishing locus of $I(h)$ is exactly the set of points where $h\notin \mathcal{O}_{Y,y}$.
To show this, suppose $\mathfrak{m}\subset A(Y)$ is a maximal ideal corresponding to $y\in Y$. Then the statement $h\in \mathcal{O}_{Y,y}=A(Y)_\mathfrak{m}$ is equivalent to $h=\frac{b}{a}$ for some $a\in A(Y)\setminus \mathfrak{m}$, so $I(h)\subset\mathfrak{m}$ iff $h\notin \mathcal{O}_{Y,y}$. This finishes the problem, since it tells us that the closed subset $V(I(h))$ is exactly the locus of points $y\in Y$ where $h\notin \mathcal{O}_{Y,y}$.
