The natural maps $\mathcal{O}(Y) \to \mathcal{O}_p \to K(Y)$ are injective On p. 16 of Hartshorne's Algebraic Geometry, he says that the natural maps $\mathcal{O}(Y) \to \mathcal{O}_p \to K(Y)$ are injective by the "identity theorem" for rational functions (i.e. if $f,g \in \mathcal{O}_Y(U)$ and $f|_V=g|_V$ for some non-empty open subset $U\subseteq V,$ then $f=g$).
Does he just mean that his definitions of equivalence of germs (i.e. $(U,f)\sim(V,g)$ if and only if $f|_{U\cap V} = g|_{U\cap V}$) rely on this and therefore, as a consequence, so does the injectivity of the above maps? Because otherwise I can't see how he's using the identity theorem...
Thanks!
 A: I think you have the right idea. Take a function $f\in \mathcal{O}(Y)$ and send it to its germ $f_P\in \mathcal{O}_P$. Suppose that $f_P=g_P$. That is to say that there exists an open neighborhood $W\ni P$ so that $f|_W$ and $g|_W$ are both defined and $f|_W=g|_W$. 
(To spell this out in more detail, this means that the representatives $(f,U)\sim (g,V)$, and so there exists $W\subseteq U\cap V$ containing $P$ with $f|_W=g|_W$. Actually, we can take $U=V=Y$ because $f$ and $g$ are global sections.)
Now, this implies that $f$ and $g$ agree on a dense open subset of the variety $Y$. Hence, $f=g$. So, the map $\mathcal{O}(Y)\to \mathcal{O}_P$ is indeed injective. For the second map, just note that $K(Y)$ is the fraction field of $\mathcal{O}(Y)$, which we know is a domain since $Y$ is a variety. In particular, by the mapping property of localization (for instance) we get an injection of $\mathcal{O}_P\to K(Y)$ simply by including a function in $\mathcal{O}_P$ to its representative in the function field.
