I'm currently doing exercise I.6.4 in Hartshorne's Algebraic Geometry. I've tried to prove this and get a so-called "proof" which full of gaps and uncertainty.
The exercise goes like this:
Let $Y$ be a nonsingular projective curve. Show that: (1) every nonconstant rational function $f$ defined on $Y$ defines a surjective morphism $\phi: Y \rightarrow \mathbb{P}^1$, (2) and that for every $P \in \mathbb{P}^1$, $\phi^{-1}(P)$ is a finite set of points.
"Proof" of (1): I get the inspiration from Question: Rational function and morphisms of quasiprojective varieties
By saying $f$ is a rational function on $Y$, we are actually given a regular function on an open set $U \subset Y$. WLOG, we may assume that $U$ here has already be maximal. What we need to do is actually define the desired morphsim on $Y-U$. To do that, consider any (fixed) point $P \in Y-U$ and the local ring $\mathcal{O}_{Y,P}$ with the maximal ideal $\mathfrak{m}_P$. Note that $Y$ is a nonsingular projective curve, $\mathcal{O}_{Y,P}$ is a DVR, and hence $\mathfrak{m}_P$ is principal. Let $\mathfrak{m}_P = (u)$.
Since $P \in Y-U$, $f$ is not contained in that local ring. Yet since $f$ is a rational function, $f \in \mathrm{Frac}(\mathcal{O}_{Y,P})=K(Y)$. Hence we can write $f$ as $f=\frac{\alpha}{\beta}$, where $\alpha, \beta \in \mathcal{O}_{Y,P}$ and $\beta \not\in (\mathcal{O}_{Y,P})^\times$. By definition, $\beta \in \mathfrak{m}_P$. Hence, there exists $\beta_1 \in \mathcal{O}_{Y,P}$, such that $\beta = \beta_1 u$.
Now if $\beta_1 \not\in \mathfrak{m}_P$, then $\frac{\alpha}{\beta_1}$ is regular amd nonzero at $P$ and $f$ can be expressed as $f=(\alpha / \beta_1) u^{-1}$. Else if $\beta_1 \in \mathfrak{m}_P$, we can carry on the process above and find $\beta_2 \in \mathcal{O}_{Y,P}$ such that $f=(\alpha / \beta_2) u^{-2}$. Such process will end in finitely many steps, for if not, we would obtain a chain $\beta_j \vert \beta_{j-1}$, which contradicts to the fact that $\mathcal{O}_{Y,P}$ is a UFD (since it is a DVR).
To sum up, we can express $f$ as $f= \rho u^{-\nu}$ for some $\rho$ a regular and nonzero at $p$ map, and $\nu$ a positive integer.
Now, we define $\phi(P)$ as $$ \phi(P) = [0:1] = [u^{\nu}(P) : \rho(P)], $$ when $P \in Y-U$. For $P \in Y$, we can define $$ \phi(P) = [1:f(P)]. $$ This is consistent with the definition for $P \in Y-P$, if we now regard $f=u^{0} f$ by taking $\nu = 0$ in above settings.
Now, here come my Question 1: Why $\phi$ is a morphism?
If we have proved that $\phi$ is a morphism, then since $\phi$ is a morphism from a PROJECTIVE curve $Y$, the image is closed in $\mathbb{P}^1$. Since $f$ is nonconstant and $Y$ is irreducible, the image of $\phi$ must be all of $\mathbb{P}^1$. Hence $\phi$ is a surjection.
Here comes my Question 2: The "proof" above seems to be a complete one. Yet it is too complicated! Is there a better way to understand the proof? I've read some post on MSE about this question, and someone mentioned that we can use the Proposition I.6.8 in Hartshorne "directly" to get the desired result. But I do not know how to apply this theorem here. Could someone provide more details on this?
P.S.The Proposition I.6.8 in Hartshorne is:
Let $X$ be an abstract nonsigular curve, let $P$ \in $X$ and $Y$ be a projective variety. Let $\phi: X-P \rightarrow Y$ be a morphism. Then there exists a unique morphism $\bar{\phi}: X \rightarrow Y$ extending $\phi$.
I still have questions on (b), yet since this question has already been quite lengthy, I will open up another post on those.
I'm so sorry to post such a lengthy post. and thank you all for answering and commenting on this post in advance!! :)
Exercise: "Let $Y$ be a nonsingular projective curve. Show that: (1) every nonconstant rational function $f$ defined on $Y$ defines a surjective morphism $ϕ:Y→P^1$, (2) and that for every $P∈P^1$, $ϕ^{−1}(P)$ is a finite set of points."
Answer: Let $C$ be an irreducible smooth projective curve over an algebraically closed field $k$ and let $K:=K(C)$ be the function field of $C$ with $x\in K$ a "non-constant" rational function. Let $P(t)\in k[t]$ and assume $P(x)=0$. Since $k$ is algebraically closed this implies $x\in k$ a contradiction, hence $x$ is "transcendental over $k$", meaning the subring $k[x] \subseteq K$ generated by $k$ and $x$ is isomorphic to a polynomial ring. You get an embedding $k \subseteq k(x) \subseteq K$ where $x$ behaves like an independent variable over $k$. This gives (by the proof of HH.I.6.12) a surjective morphism
$$\phi: C \rightarrow \mathbb{P}^1_k.$$
Since $C$ is projective and irreducible, the image is closed and irreducible and hence $Im(\phi)=\mathbb{P}^1_k$. The inverse image $\phi^{-1}(x)$ of a closed point $x\in \mathbb{P}^1_k$ is a strict closed subvariety of $C$ (since $\phi$ is non-constant) and since $C$ is irreducible it follows $\phi^{-1}(x)$ must be a finite set of points.
Note: Since $k$ is algebraically closed it follows any polynomial $P(t) \in k[t]$ factors as
$$P(t)=(t-a_1)\cdots (t-a_n)$$
with $a_i \in k$. Hence if $P(x)=0$ it follows $x=a_i\in k$ for some $i$ - a contradiction since $x$ is assumed to be "non-constant".