Using the Maximum Modulus Principle to prove that every holomorphic function on a compact Riemann surface is constant I have read in a number of sources (including here) that a holomorphic function on a compact Riemann surface must be constant. The reason given has always been the Maximum Modulus principle, but without explaining why. I could use some help in proving this result.

Let $\Sigma$ be a connected compact Riemann surface, and let $f : \Sigma \to \mathbb{C}$ be a holomorphic function. 
As $|f| : \Sigma \to \mathbb{R}$ is continuous and $\Sigma$ is compact, it attains a maximum value $M$. By continuity, $S := \{p \in \Sigma \mid |f(p)| = M\}$ is closed.
Suppose $q \in \Sigma$ is such that $|f(q)| = M$. Let $(U, \varphi)$ be a coordinate chart centred at $q$. That is, $U$ is an open neighbourhood of $q$ and $\varphi : U \to \mathbb{D}$ is a biholomorphism with $\varphi(q) = 0$. Consider the map $f\circ\varphi^{-1} : \mathbb{D} \to \mathbb{C}$. Note that $(f\circ\varphi^{-1})(0) = (f\circ\varphi^{-1})(\varphi(q)) = f(q)$, so 
$$M = |f(q)| = |(f\circ\varphi^{-1})(0)| \geq |(f\circ\varphi^{-1})(z)|$$
for all $z \in \mathbb{D}$. By the Maximum Modulus Principle, $f\circ\varphi^{-1}$ is constant, and therefore, $f$ is constant on $U$. So for any $z \in U$, $f(z) = f(q)$ and hence $|f(z)| = |f(q)| = M$. Therefore $z \in S$ and hence $U \subseteq S$, so $S$ is open.
As $S$ is both open and closed, and $\Sigma$ is connected, $S = \Sigma$. That is, $|f(p)| = M$ for every $p \in \Sigma$, so $f(\Sigma) \subseteq \{z \in \mathbb{C} \mid |z| = M\}$.
Finally, use the fact that if $f$ were non-constant, it would be an open map which is impossible.

Note, this proof does not make use of the identity theorem, but it does use the open mapping theorem (i.e. non-constant holomorphic maps are open). Alternatively, one could give a proof which uses the identity theorem, but not the open mapping theorem. Namely, once it has been shown that $f$ is constant on $U$ (as is done above in the proof that $S$ is open), it follows immediately that $f$ is constant by the identity theorem. Both proofs require the Maximum Modulus Principle.
