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?

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.
