Residue field at the generic point is equal to the fraction field of the section I want to show that:
If $X$ is a non-empty integral scheme and $U \subset X$ is an affine, non-empty, open subset of $X$ then
$$ K_{X, \eta} = \text{Frac}(\mathcal{O}_X(U)).$$
Here $K_{X, \eta}$ is the residue field at the generic point $\eta$. 
So the proof starts like this:
We define a morphism
$$ \mathcal{O}_X(U) \rightarrow K_{X, \eta} = O_{X, \eta}, \ s \mapsto [(U,s)].$$
This map is injective because if $[(U,s)]=0$ then $s(\eta)=0$ in $K_{X, \eta}$. The set $V=\{x \in U \ | \ s(x) = 0 \in K_{X,x} \}$ is closed in $U$ and contains $\eta$. Hence the set $V$ must be all of $U$. Therefore $s=0$. 
My explanation why $V$ is closed: $U$ is affine so we may assume that $U = \text{Spec}(A)$ for some ring $A$. Then $\mathcal{O}_X(U) = {\mathcal{O}_X}|_U (U) = A$. So the element $s$ corresponds to some $a \in A$. In $V$ we have: $\mathfrak{p} \in V$ then $s(\mathfrak{p}) = \frac{s}{1} \equiv 0 \in A_{\mathfrak{p}} / {\mathfrak{p} A_{\mathfrak{p}}}$. Thus $s \in \mathfrak{p}$. So the set $V$ is just the set of primes that contain $s$, which is closed.
If my explanation is correct, how does it then follow that $s=0$? Is it because if $V=U$ then all primes $\mathfrak{p}$ contain $s$, so $s \in rad(A) = \{0\}$ because $A$ is an integral domain? 
 A: This is not exactly what you asked, but here's another way to see that $K_{X,\eta}=\text{Frac}(\mathcal{O}_{X,\eta})$.
If $U=\text{Spec}(A)$, then $\eta\in U$ (since $\eta$ is generic). In particular, $\eta$ is generic in the affine scheme $U$. Since $A$ is a domain, $\eta$ corresponds to the minimal prime $(0)\subset A$, therefore:
$$K_{X,\eta}=\mathcal{O}_{X,\eta}=\mathcal{O}_{U,\eta}\simeq A_{(0)}=\text{Frac}(A)=\text{Frac}(\mathcal{O}_X(U))$$
A: Your reason for $s=0$ is correct. It is interesting that the map $\mathcal{O}_X(U)\to K_{X,\eta}$ is injective even when $U$ is not affine. What you have done for the affine case is generalized into two facts:


*

*Let $X$ be a scheme (in fact this is true for a locally ringed space). Let $f\in \mathcal{O}_X(U)$. The set of point $x\in U$ such that $f$ vanishes at $x$ is closed in $U$.


*Let $X$ be a reduced scheme (every stalk is a reduced ring, i.e. ring with no nilpotent). Then a section $f$ over $U$ vanishes at every point of $U$ if and only if $f=0$.

Since $X$ is an integral scheme, it is reduced and irreducible with generic point $\eta$. If $[(U,s)]=0$ then $s(\eta)=0$, so $s$ vanishes on $\overline{\{\eta\}}\cap U=U$. But $X$ is reduced so $s=0$.
