This is a basic question in algebraic geometry which probably is already answered somewhere in the web, but I am struggling too much on it and I couldn't find anything which could be of help.I thought that it is maybe worth to ask you if you can give me the right idea.
I use a step inside the proof of Corollary II.6.10 of Hartshorne, Algebraic Geometry, as an example of the idea I am struggling to get. In the following $X$ is a curve (in the sense of Hartshorne, i.e. integral separated (complete nonsingular) scheme of finite type and dimension $1$ over a field $k$) and $K(X)$ is the field of rational functions on it. Given $f\in K(X)^*$ such that $f\notin k$, consider the extension $k(f)\subset K(X)$ of field.
Claim: this extension of fields induces a morphisms $X\to\mathbb{P}^1$ of curves.
What I thought: I know (Hartshorne, Corollary I.6.12) that there is an equivalence of categories between the category of nonsingular projective curves with dominant morphisms and the category of function fields of dimension $1$ over $k$ with $k$-homomorphisms. Moreover this equivalence reverse the arrows (Theorem I.4.4). The equivalence is described in terms of abstract nonsingular curves as defined by Hartshorne in Section I.6. In particular, to every function field $K$ of dimension $1$ we can associate a nonsingular projective curve $C_K$ (Theorem I.6.9). Coming back to the claim, I should get a morphism of curves $$X\to C_{k(f)}.$$ Now, why is $C_{k(f)}\cong\mathbb{P}^1$?
I've tried to work out something explicitly, but it turns out that this situation is too generic. Moreover, later on inside the book (exercise IV.2.2.(b)), he seems to claim the same using the extension $k(x)\subset k(x,\beta)$ (here $\beta$ is the solution in $k(x,y)$ of a polynomial in $k(x)[y]$). I mean that he defines the morphism $X=C_{k(x,\beta)}\to\mathbb{P}^1$, from whom I deduce (maybe erroneously) that $C_{k(x)}\cong\mathbb{P}^1$ as well. I think I am lacking something theoretic here.
Disclaimer: from a complex geometric point of view, I know that a meromorphic function $f$ on a curve $X$ gives a morphism $X\to\mathbb{P}^1$ sending $x$ to $f(x)$ and this is exactly what I expect the map in the claim does. This is also quite convincing that the answer to the question is affirmative for every $f\in K(X)$ (even if there still is a discrepancy between that function field and $K(\mathbb{P}^1)$). But what about $k(x)$? I have no evidence for it.
Thank you very much for any kind of hint/suggestion/advice/answer you can give me and I hope I am not completely misunderstanding everything!