I'm solving problems in Hartshorne. I don't know how to solve the following exercise(6.4 of Chapter 1): Let $Y$ be a nonsingular projective curve. Show that every nonconstant rational function $f$ on $Y$ defines a surjective morphism $\phi:Y\rightarrow \mathbb P^1$.
I know I can use 6.7 and 6.8 to extend the morphism $f$ to such a $\phi$. But I don't know how to prove it's surjective. I have tried something:
Through $\phi$ we get an injection $k(x)\rightarrow K(Y)$. Since all $DVR$ in $k(x)$ looks like $k[x]_{(x)}$, it's enough for us to just prove there is a DVR induced by a point in $Y$ dominates $k[x]_{(x)}$. I can find one DVR (denote it by $B$)by taking the integral closure of $k[x]$ in $K$ and do a localization at a prime that dominates $(x)$.(Just as the proof of 6.5) But I can't show it is a DVR induced by a point in Y. Could you provide some help? Thanks!