I would like to show the following (note: it is not an assigned problem, so it may be false) (EDIT: Indeed it is false, see end of post):
Suppose $f:X \rightarrow Y$ is a finite, surjective morphism of integral nonsingular curves over $k$ algebraically closed. If the fiber over some point $p$ of $Y$ contains exactly one point of $X$, then $f$ is birational. (Since a finite map is affine, we can reduce to the case $X=SpecA$, $Y=SpecB$)
In browsing around trying to prove this, I came upon Vakil's definition of the degree of a finite morphism at a point (Section 13.7 of his online notes). He defines the degree of $f$ at $p$ to be the dimension of $(f_*O_X)_p \otimes _{O_{Y,p}} k(p)$ as a $k(p)$ vector space, where $k(p)$ denotes the residue field of $Y$ at $p$. In an exercise, he asserts that degree is an upper semicontinuous function of the point on $Y$.
My feeling is that this solves my problem. Degree as defined above is the dimension of the vector space of functions on the fiber over the field $k(p)$ (=$k$, since I assumed algebraically closed). Morally, this should be the number of points in the fiber, with a basis of functions being those which send one point in the fiber to 1 and the others to 0. Then, since degree counts the fiber, is upper semicontinuous, and equal to 1 at some point, then $f$ must be injective in a neighborhood, hence birational.
My problem is that "morally" is not a proof and weird commutative algebra things can happen. So if my thought process is correct, can someone prove it to me? Also, if I am indeed on the right track, then in what kind of generality can one say that "degree (as defined above) counts the fiber"? Thanks.
EDIT: Li Yutong gives the example of projection of the curve $xy = z^2$ in $\mathbb{P}^2$ to $\mathbb{P}^1$. It is a 2:1 map except over the points (0:1) and (1:0) where it is 1:1. Since my proposition fails in such a nice case, my thinking about Vakil's "degree" must be way wrong. Can somebody point out where I'm jumping the shark?