As requested by Georges, here are a few words about the positive characteristic situation.
Let $k$ be a field of characteristic $p>0$. Any finite morphism of smooth projective curves $f: X\to Y$ over $k$ decomposes into $X\to Z\to Y$ where $Z\to Y$ is separable (meaning that the extension of functions fields $k(Z)/k(Y)$ is separable, and where $X\to Z$ is purely inseparable. This corresponds to the decomposition of any finite algebraic extensions into separable then purely inseparable extensions, and results from the correspondance between functions fields and projective normal curves.
One can show that $Z$ is smooth because $X$ is smooth (as $Z$ is regular of dimension $1$, $X\to Z$ is flat, so $X_{\bar{k}}\to Z_{\bar{k}}$ is flat, then the regularity of $X_{\bar{k}}$ implies that of $Z_{\bar{k}}$).
Proposition. We have $g(X)=g(Z)$ as curves over $k$.
Proof. The purely inseparable extension $k(X)/k(Z)$ can be decomposed into successive inseparable extensions of degree $p$. So we are reduced to the case $[k(X) : k(Z)]=p$. As $X$ is smooth, $k(X)$ is a finite separable extension of some $k(t)$: $k(X)=k(t)[\theta]$. Consider $k(t^p)[\theta^p]$. It is contained in $k(Z)$ because any $p$-th power of elements of $k(X)$ belongs to $k(Z)$. It is not hard to see that $k(t^p)[\theta^p]$ has index $p$ in $k(X)$. Therefore $k(Z)=k(t^p)[\theta^p]$. This implies that $X\to Z$ is in fact the relative Frobenius map $X\to X^{(p)}$. In other words, $Z=X\otimes_k k'$ where $k'=k$ is viewed as an extension of $k$ by $\lambda\mapsto \lambda^p$. Since the genus in invariant by field extensions, we get $g(Z)=g(X)$.
Now suppose we have a finite morphism $X=\mathbb P^1_k\to Y$. Then $g(Z)=0$, hence $Z$ is a smooth conic with a rational point (because $X$ has a rational point), so $Z\simeq \mathbb P^1_k$. Therefore we get a finite separable morphism $\mathbb P^1_k\to Y$. This implies $Y$ is isomorphic to $\mathbb P^1_k$ using Hurwitz as did Georges.