Don't understand proof on pg 65 of Qing Liu There is proposition in page 65 of Liu's book which is: $X$ an integral scheme with generic point $\xi$. Then if we identify $\mathcal{O}_X(U)$ with and $\mathcal{O}_{X,x}$ we have $\mathcal{O}_X(U) = \bigcap_{x \in U} \mathcal{O}_{X,x}$. His proof is like this.
"By covering $U$ with affine open sets we can assume $U = \operatorname{Spec}(A)$ is affine.  let $f \in \text{Frac}(A)$ be contained in all the localizations $A_\mathfrak{p}$ for $\mathfrak{p} \in \operatorname{Spec}(A)$. Let $I = \{g \in A | fg \in A\}$. Then $I$ is not contained in any prime ideal so that $I = A$. It follows $f \in A$"
I have two questions:


*

*How can we reduce to the case that $U = \operatorname{Spec}(A)$ is affine? If I write $\{V_i\}$ a cover by affines for $U$, then  $\mathcal{O}(U) = \bigcap \mathcal{O}(V_i)$ but where is intersection taken inside of?

*Why is $I$ not contained in any prime ideal?
 A: For an integral scheme $X$ with generic point $\xi$, for each open subset $U\subseteq X$, $\xi\in U$, so there is a canonical homomorphism $\mathscr{O}_X(U)\rightarrow\mathscr{O}_{X,\xi}=:k(X)$ (the function field of $X$). If $U=\mathrm{Spec}(A)$ is affine, then this can be identified with the canonical inclusion of the domain $A$ into its field of fractions $\mathrm{Frac}(A)$. It then follows for a general $U$ that the map to $k(X)$ is injective, because, if $s\in\mathscr{O}_X(U)$ maps to zero, then the restriction of $s$ to each affine open inside $U$ maps to zero, which means the restriction to that affine is zero (by the affine case!), so $s=0$. So you can take the intersection of all the $\mathscr{O}_X(U)$ inside the function field $k(X)$, and then your equality $\mathscr{O}_X(U)=\bigcap_i\mathscr{O}_X(V_i)$ for $U=\bigcup_i V_i$ an affine open cover (or any open cover whatsoever) makes sense. Similarly each $\mathscr{O}_{X,x}$ canonically injects into $k(X)$, because every point $x\in X$ is a specialization of the generic point $\xi$, and, again consider an affine open around each point, localizations of a domain all canonically inject into the domain's field of fractions.
Now, the argument quoted proves that the natural map $\mathscr{O}_X(U)\rightarrow\bigcap_{x\in U}\mathscr{O}_{X,x}$ is an isomorphism for $U$ affine, but you don't actually need it. For general $U$, the map is injective simply because $\mathscr{O}_X$ is a sheaf (in fact, because $X$ is integral, each $\mathscr{O}_X(U)\rightarrow\mathscr{O}_{X,x}$, $x\in U$, is injective). Now if $s$ is an element of the intersection of the stalks (taken in $k(X)$), for each $x$ we can find an affine open $U_x\subseteq U$ containing $x$ such that $s$ is the image of a section $t(x)\in\mathscr{O}_X(U_x)$ (this is just an application of the definition of the stalk of a sheaf, and in the argument above, the $s_\mathfrak{p}$ were denoted $t(x)$). Then $U=\bigcup_x U_x$, and the sections $t(x)\vert_{U_x\cap U_y}$ and $t(y)\vert_{U_x\cap U_y}$ for $x\neq y$ map to the same element in $k(X)$ (namely $s$) so they are equal in $\mathscr{O}_X(U_x\cap U_y)$ by the injectivity proved above. So they agree on $U_x\cap U_y$, and therefore they can be glued to a section $t$ of $U$ which satisfies $t\vert_{U_x}=t(x)$, and in particular, the image of $t$ in $\bigcap_{x\in U}\mathscr{O}_{X,x}$ will be $s$.
The reason $I$ is not contained in any prime ideal is that $f\in\bigcap_\mathfrak{p}A_\mathfrak{p}$. If $\mathfrak{p}$ is a prime ideal of $A$, then because $f$ lies in $A_\mathfrak{p}$, it can be written as a fraction $a/g$ for some $g\in A\setminus\mathfrak{p}$, and then $gf=a\in A$, so $g\in I$. Therefore, for each prime ideal of $A$, there is some element of $A$ not in that prime ideal which is contained in $I$. So $I$ cannot be contained in any prime ideals of $A$. 
Let me now say why, when $X=\mathrm{Spec}(A)$ is affine, and I want to prove that $\mathscr{O}_X(X)\rightarrow\bigcap_{x\in X}\mathscr{O}_{X,x}$ is an isomorphism, meaning I want to prove that $A\rightarrow\bigcap_{\mathfrak{p}\in\mathrm{Spec}(A)}A_\mathfrak{p}\subseteq\mathrm{Frac}(A)$ is an isomorphism, the argument I gave translates to one involving the "ideal of denominators of $f$," which is the ideal $I$ of the previous paragraph. Given $f\in \mathrm{Frac}(A)$ which lies in all the stalks $A_\mathfrak{p}$ (more precisely their images in $\mathrm{Frac}(A)$), I know from the definition of localization that for each $\mathfrak{p}$ I can write $f=a_\mathfrak{p}/s_\mathfrak{p}$ for some $a_\mathfrak{p},s_\mathfrak{p}$ with $s_\mathfrak{p}\notin \mathfrak{p}$. In geometric terminology, this is saying precisely that $f$ comes from a section of the affine open $D(s_\mathfrak{p})$ of $\mathrm{Spec}(A)$, namely it comes from $a_\mathfrak{p}/s_\mathfrak{p}\in A_{s_\mathfrak{p}}=\mathscr{O}_X(D(s_\mathfrak{p}))$. Since $\mathfrak{p}\in D(s_\mathfrak{p})$ for each $\mathfrak{p}$ by construction, these open sets cover $\mathrm{Spec}(A)$. The equality $\mathrm{Spec}(A)=\bigcup_{\mathfrak{p}\in\mathrm{Spec}(A)}D(s_\mathfrak{p})$ is literally equivalent to: the ideal of $A$ generated by the $s_\mathfrak{p}$ (which is contained in the ideal $I$ of the previous paragraph) is equal to $A$. So the ideal of denominators is all of $A$, and that means $f=1\cdot f\in A$.
