Show that a compact Riemann surface of genus two is hyperelliptic 
Suppose $M$ is a compact Riemann surface of genus 2. Then $M$ is hyperelliptic.

This is an old question and there have been some relevant posts on MSE. But I wonder if there is a more direct method. For example, I want to construct the meromorphic function giving the degree-two cover of $\Bbb P^1$. It seems if $\alpha_1, \alpha_2$ form a basis of the space of holomorphic differentials $H^0(M, \Omega^1)$, then $f=\frac{\alpha_1}{\alpha_2}$ is of degree 2. $f$ is obviously a meromorphic function since it is independent of chart choice. And it is not a constant and with degree $>1$, otherwise $M$ is isomorphic to the Riemann sphere. But I don't know hw to carry on to the degree is exactly 2, maybe counting $f^{-1}(\infty)$?
I am just learning Riemann-Roch theorem and I unfamiliar with the language of algebraic geometry. Could you explain in the language of Riemann surfaces? I would appreciate any help or hint! A proper reference is also OK.

Let $M$ be a genus $g$ compact Riemann surface. Then every abelian differential of first kind (i.e., an element of $H^0(M,\Omega_M^1)$) has $2g -2$ zeros (Gauss-Bonnet: $\int_M c_1(\Omega^{1}_M)= 2g - 2$). Therefore, when $g=2$, your function $f$ has two poles.
