Let $\phi:X\to Y$ be a morphism of nonsigular complete curves. Let Spec $A:=U\subset Y$ be an open set. Why is $\phi^{-1} (U) =$ Spec $B$, the spectrum of the integral closure of $A$ in $K(X)$? Can we weaken the hypothesis of nonsingularity and completeness?
This statement is, for example, in Hartshorne II.6.8. I see the containment $\phi^{-1} U \subset$ Spec $B$, but how do I prove the other one? How do I finish the following argument (is this the way to think about it?)?
Every point $p\in \phi^{-1}(U)$ is such that the local ring $\mathcal O_{Y,q}$ of some $q\in U$ dominates $\mathcal O_{X,p}$...
Your morphism has to be dominant, otherwise the conclusion may be false. In this case the morphism is certainly proper because $Y$ is separated and $X/k$ is. So the pre-image of a point is a finite set and your morphism is quasi-finite, but a proper quasi finite morphism is finite. The non-singularity hypothesis is thus not needed.
Now you can also finish Harsthorne's argument (which doesn't seem natural to me) in the following manner. As $\text{Spec }B$ is isomorphic to an open subset of $X$ say $V$, that is mapped to $U$, you certainly have $V\subset \phi^{-1}(U)$. The other inclusion is given by the fact that if $X\to Y$ is a dominant morphism with $X$ normal and $Y$ integral (which is your case) then it factorises through the normalisation of $Y$ in an extension of its function field.
On the algebraic side let $R=O_X(\phi^{-1}(U))$ then $R$ is normal in $K(X)$, finite over $A$, thus it is $B$, as $\text{Spec }B$ is a subset of $\phi^{-1}(U)$ they must be equal.