Principal divisors on a compact Riemann surface Let $X$ be a compact Riemann surface, and $f$ a meromorphic function on X.
There's a theorem telling us that $\deg(\mathrm{div}(f)) = 0$.
But is the inverse statement also true? I mean, is it true that:

if $D$ is a divisor on $X$ with $\deg(D) = 0$, then exists a meromorphic
function $f$ on $X$ such that $D = \mathrm{div}(f)$?

Thanks!
 A: That is not true. Here a counterexample: consider a Riemann surface $X$ of genus $g \geq 1$. Fix $p, q \in X$ distinct points and consider the divisor $D = p - q$. This divisor has degree $0$, but it is not principal, because on the contrary there would be a holomorphic map $f: X \rightarrow \overline{\mathbb{C}}$ of degree equal to $1$ (for it has single simple zero/infinity value), and it is well known that a such map with this property is an isomorphism. That is a contradiction, since $g(\overline{\mathbb{C}}) = 0$. Look for Abel-Jacobi Theorem for necessary and sufficient conditions for a divisor be principal.
A: Rafael answer shows that if every degree zero divisor on $X$ is principal then $X$ is isomorphic to the Riemann sphere $\mathbb{C}_{\infty}$.
The converse also holds true, i.e., every degree zero divisor $D$ on $\mathbb{C}_{\infty}$ is principal. To see this just note that if $D = \sum n_i \cdot z_i + n_{\infty}\cdot \infty$ and $n_\infty = - \sum n_i$ then $f(z) = \Pi (z-z_i)^{n_i} $ is a rational function (hence meromorphic on $\mathbb{C}_{\infty}$) such that div$(f) = D$.
