Proof of Hartshorne Proposition II 6.8 I would like to ask one question (maybe very simple) about the proof of Proposition II 6.8 in Hartshorne's book Algebraic Geometry page 137.  The question is about the proof of the finiteness of non-trivial morphisms between two projective non-singular curves.  In his proof, let $f:\ X \to Y$ be a non-trivial morphism, i.e. $f(X) =Y$ and let $V = \mathrm{Spec} B$ be any open affine subset of $Y$. Denote by $A$ the integral closure of $B$ in $K(X)$, where $K(X)$ is the function field of $X$. Here we regard $B \subset K(Y) \subset K(X)$, then I understand $\mathrm{Spec} A$ is isomorphic to an open subset $U$ of $X$ by the definitions of abstract non-singular curves and their topology introduced in Chapter I, section 6. But then the proof says clearly $\mathrm{Spec} A \cong  f^{-1}(V)$. It is this argument that I do not understand. I can see $\mathrm{Spec} A \subset f^{-1}(V)$.     
I would really appreciate if someone could explain this, i.e. why finding the inverse is the same as finding the integral closure in the functional field. 
 A: See this explanation http://therisingsea.org/notes/Section2.6-Divisors.pdf Proposition 20.
A: This is a more general fact:
Let $f:X\rightarrow Y$ is a surjective morphism between irreducible varieties. Then $dim(Y)\leq dim(X)$. Furthermore:


*

*$dim(F)\geq dim(X)-dim(Y)$ for any component of the fiber $f^{-1}(y)$ for any $y\in Y$.

*there is a non-empty open subset $U\subset Y$ such that $dim(f^{-1}(y)) = dim(X)-dim(Y)$ for any $y\in U$.


you might think of this in a more differential way. Take a general point $y\in Y$ and let $x\in f^{-1}(y)$ be general on the fiber. Then $x$ is a smooth point of both $X$ and $f^{-1}(y)$. Consider the differential $df_{x}:T_{x}X\rightarrow T_{y}X$. Now $T_{x}f^{-1}(y) = Ker (df_{x})$, and the result follows just by the dimension theorem in linear algebra and by semicontinuity.
A: Surely too late, but for further research: If $x\in X$ with $f(x)\in V$. In terms of elements of $C_{K(X)}$, $f(x)$ is $\mathcal{O}_x\cap C_{K(Y)}$ and $\mathrm{Spec}(B)$ is $\{y\,|\,\mathcal{O}_y\supseteq B\}$ (cf proof of I.6.7 second paragraph) so $f(x)\in V=\mathrm{Spec}(V)$ iff $\mathcal{O}_x\supseteq B$. But $\mathcal{O}_x$ is a discret valuation ring hence it is integrally closed so $\mathcal{O}_x\supseteq B$ imply $\mathcal{O}_x\supseteq\overline{B}=A$ ie $x\in\mathrm{Spec}(A)$.
