How to glue the integral closures of the affine pieces in an integral scheme (Hartshorne II.3.8)? I'm doing Exercise 3.8 in Chapter II of Hartshorne, on the construction of the normalization of an integral scheme. Let $X$ be an integral scheme and let $\{U_i=\operatorname{Spec}(A_i)\}_{i\in I}$ the set of all non-empty affine open subsets of $X$, indexed by some index set $I$. For $i\in I$ let $\tilde{U_i}:=\operatorname{Spec}(\tilde{A_i})$, where $\tilde{A_i}$ is the integral closure of $A_i$ inside its fraction field. According to Hartshorne, the $\tilde{U_i}$'s can be glued together, and the resulting scheme will be the normalization of $X$. So in order to glue them together (with exercise 2.12, the Glueing lemma), we need to define open sets $U_{ij}\subseteq \tilde{U_i}$ for all $i\neq j$, such that for all such $i,j$ we have an isomorphism $\varphi_{ij}:U_{ij}\to U_{ji}$, along with some more compatibility properties. But I'm already struggling with the proper definition of $U_{ij}$. The natural thing to do would be to define $U_{ij}:=\iota_{i}^{-1}(U_i\cap U_j)$, where $\iota_i:\tilde{U_i}\to U_i$ is the morphism induced from the inclusion $A_i\hookrightarrow \tilde{A_i}$. But then I don't see how to construct the isomorphism $\varphi_{ij}$, because there could be many prime ideals in $\tilde{A_i}$ contracting to the same ideal in $A_i$. How to proceed?
 A: $\newcommand{\ol}{\overline} \newcommand{\Frac}{\operatorname{Frac}} \newcommand{\Spec}{\operatorname{Spec}}$
Lemma. If $\Spec A$ and $\Spec B$ are two affine open subschemes of a common scheme $X$, the intersection $\Spec A\cap \Spec B$ can be covered by simultaneously-distinguished affine opens $\Spec A_f = \Spec B_g$.
Proof: see here, for instance. $\blacksquare$
Lemma: localization commutes with taking integral closures. To be precise, let $A$ be an integral domain, $S$ a multiplicatively closed subset of $A$, and let $\ol{A}$ denote the integral closure of $A$ in its field of fractions.
Then the claim is that $\ol{S^{-1}A}=S^{-1}\ol{A}$.
Proof: In one direction, $S^{-1}\ol{A}\subset \ol{S^{-1}A}$: if $z\in\Frac{A}$ is integral over $A$, satisfying the monic polynomial $x^n+\sum_{i=0}^{n-1} a_ix^i$ where $a_i\in A$, then $\frac{z}{s}$ is integral over $\ol{S^{-1}A}$ since it satisfies the monic polynomial $x^n+\sum_{i=0}^{n-1} \frac{a_i}{s^{n-i}} x^i$ which has coefficients in $S^{-1}A$.
Conversely, if $\frac{f}{g}\in Frac(A)$ is integral over $S^{-1}A$, then it satisfies the monic polynomial $x^n+\sum_{i=0}^{n-1} a_ix^i$ where $a_i\in S^{-1}A$.
But then we can find an $s\in S$ so that $s\frac{f}{g}$ satisfies the monic polynomial $x^n+\sum_{i=0}^{n-1} a_i'x^i$ with $a_i'\in A$ by clearing denominators appropriately.
So $\ol{S^{-1}A}\subset S^{-1}\ol{A}$, and the claim is proven. $\blacksquare$
Now suppose that $\{\Spec A_i\}_{i\in I}$ is the collection of all open affine subschemes of $X$.
Since the $\Spec A_i$ glue together to form $X$, we have a gluing data as per exercise II.2.12.
Now cover $\Spec A_i\cap \Spec A_j$ by simultaneously-distinguished open subsets $\Spec (A_i)_a=\Spec (A_j)_b$ by the first lemma.
Since integral closures commute with localizations, we have that the preimage of $\Spec (A_i)_a$ in $\Spec \ol{A_i}$ and $\Spec (A_i)_b$ in $\Spec \ol{A_j}$ are both isomorphic.
This implies that the preimages of $\Spec A_i\cap \Spec A_j$ in $\Spec \ol{A_i}$ and $\Spec \ol{A_j}$ are isomorphic, and since we constructed this isomorphism naturally, we have that it forms a gluing data for the $\Spec \ol{A_i}$, giving us $\nu(X)$, the normalization.
A: You should think of restricting to open subsets as localization, then use the fact that localization and normalization commute. That is, if you localize then normalize, you get the same answer as if you were to normalize and then localize.
