Consider non-constant holomorphic mapping $f:M_{1} \longrightarrow M_{2}$ between compact Riemann surfaces, then $$ g(M_{1})\geq g(M_{2}),$$ where denotes the genus of $M_{1}$ by $g(M_{1})$, and the same $g(M_{2})$.
I try to use the conclusion
$$H^{1} \cong H_{dR}^{1}(M),$$ where $H^{1}:=\{$Harmonic 1-forms of Riemann surface$\}$, and $H_{dR}^{1}(M)$ is the de Rham cohomology.
By this conclusion, $2g(M_{1})= \dim H^{1}= \dim H_{dR}^{1}(M)$, which means $g$ is a topology invariance. Moreover, $H^{1}=\mathscr{H}\oplus \bar{\mathscr{H}}$, where $\mathscr{H}$ is the holomorphic 1-form and $\bar{\mathscr{H}}$ conjugate. Hence, $$g(M_{1})= \dim \mathscr{H}$$
My question is why $\dim \mathscr{H}$ of $M_{1}$ is greater than $M_{2}$?
$\textbf{New edited}$
@Laurent Moret-Bailly Following this idea, if $\omega$ is a holomorphic 1-form on $M_{2}$, and consider the pullback of $\omega$: $$f^{*}: H^{0}(M_{2}) \longrightarrow H^{0}(M_{1}),$$ then $f^{*}\omega$ is a holomorphic 1-form on $M_{1}$.
How about the next? Is there a related between $(f^{*}\omega)$ and $f^{*}(\omega)$?
You may use Riemann-Hurwitz Formula,
to conclude that $2g(M_1) - 2 = deg(f)(2g(M_2) - 2) + deg R_f \geq2g(M_2)-2$.
Following @Laurent Moret-Bailly 's idea, we can show that $f^*$ is injective.
Suppose $f^*\omega = 0$, i.e. $\forall p\in X, v\in T_pX,f^*\omega(v)=0$
If $p$ is not a ramification point, $f$ induces an isomorphism on tangent spaces, and hence $\omega|_{f(p)} = 0 $.
So $\omega|_q = 0$ for all but finite $q\in Y$, and thus $\omega = 0$.