Hurwitz proved in 1893 that the number of automorphisms of a Riemann surface of genus $g \geq 2$ is bounded by $84(g-1)$. See Wikipedia for some references. I want to understand the proof in the language of algebraic geometry, namely for a complete algebraic curve $X$ over an algebraically closed field of characteristic $0$. It uses Hurwitz' Theorem and it is outlined in this blog entry and also in Hartshorne, Exercise IV.2.5.

The proof starts as follows: It is known that $G := \text{Aut}(X)$ is finite, say of order $n$. Now $G$ acts on the field $K(X)$ and $K(X)^G \subseteq K(X)$ is a finite Galois extension of degree $n$. Thus it corresponds to a finite separable morphism $f : X \to Y$ of degree $n$. Finally Hurwitz' Theorem is applied to $f$.

Now it seems to me that Hartshorne's exercise, Part a, as well as the blog entry ("We’ll think analytically for a moment.[...]") use that $Y$ is the quotient of $X$ by $G$ in the category of ringed spaces, especially in the category of topological spaces. Namely this is needed to show how the fibers and ramification indices of $f$ looks like.

But from abstract nonsense we just get that $Y$ is the quotient of $X$ by $G$ in the category of complete curves, that is $f$ is $G$-invariant and every $G$-invariant dominant morphism $X \to Z$, where $Z$ is a complete curve, factors uniquely through $f$. How does this tell us how $f$ looks like as a map and what are the stalk maps, in order to calculate ramification?

Or do we use the explicitly constructed abstract complete curve associated to $K(X)^G$, thus consider *all* discrete valuation rings in $K(X)^G$? But then $f$ is, a priori, only defined rationally, right? So to sum up my problems: I don't know how to work with $f$.