TITLE: Principal divisors on a compact Riemann surface
QUESTION [8 upvotes]: 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!

REPLY [3 votes]: 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$.