Q:

Hartshorne II Prop 6.8

My weaknesses with commutative algebra are really slowing down my progress through Hartshorne.  I hope someone can help me understand some statements in the proof of the proposition below.

Prop 6.8: Let $X$ be a complete nonsingular curve over $k$, let $Y$ be any curve over $k$, and let $f:X\to Y$ be a morphism.  Then either (1) $f(X)=$ a point, or (2) $f(X)=Y$.  In case (2), $K(X)$ is a finite extension field of $K(Y)$, $f$ is a finite morphism, and $Y$ is also complete.  

I am confused about two statements in the proof, when we have case (2):  First, how do we know that $K(X)$ and $K(Y)$ finitely generated extension fields of $k$?  Second, why is it clear that $U=f^{-1}V$?
Also, Hartshorne then goes on to define the degree of any finite morphism $f:X\to Y$ of curves as the degree of the field extension $[K(X):K(Y)]$.  But how do we know that $K(X)$ contains $K(Y)$?  

A:

1) The fact that they are finitely generated extensions over $k$ is proved in Chapter I, Theorem 4.4. The point is that the function field of a variety $X$ is always determined by a dense open subset, so you can reduce to the affine case where it is pretty easy to see $K(X)$ is a finitely generated extension of $k$. 
2) If $f:X\to Y$ is dominant, it induces an injection $K(Y)\subset K(X)$, and thus $K(X)$ is a finite extension of $K(Y)$.
3) To see that $U=f^{-1}(V)$, define $U$ as $f^{-1}(V)$ and note that it is integrally closed (by smoothness assumption). 

