Proof of Hurwitz's automorphisms theorem 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$.
 A: Here is an extremely useful fact: if $X$ is a regular variety and $f \colon X \dashrightarrow \mathbf{P}^n$ is a rational map defined on a dense open $U \subset X$, then $\mathcal{f}$ extends uniquely to a maximal open subset $U'$ of $X$ and the complement of $U'$ has codimension at least two. In particular, when $X$ is a smooth curve there is a unique extension to the whole curve. Now apply this to the rational map from $X$ to the complete curve associated to $k(X)^G$, which you know can be embedded in a projective space. I don't have the book on me but this is certainly somewhere in Hartshorne. The proof goes by using that the local ring of a point in codimension one is a DVR, so you can write down an explicit extension of the map $f$ in codim 1 by multiplying through by the lowest possible power of a uniformizer.
On a sidenote, this useful fact is already needed to show that there is a unique smooth complete curve associated to a function field in one variable. 
Edit. I think I see now what you are getting at: you want to know why the points of $X/G$ correspond to $G$-orbits on $X$, right? (Knowing this, it immediately follows that if $P$ is a ramification point of order $e_P$, then it has $|G|/e_P$ conjugates under $G$.) There is a general theorem of Emmy Noether on quotients of affine varieties by finite groups which will show this, which can be found in any book on commutative algebra. But for curves I guess you could make a direct proof as follows: pick points $P$ and $Q$ on $X$ in different orbits. Since the function field separates points you can choose a function that vanishes at $P$ but not at $Q$. Do the same thing also for the conjugates of $Q$. Then a linear combination $F$ of these functions is nonzero on all conjugates of $Q$. Take the product of all conjugates of $F$ under the $G$-action: this is a $G$-invariant function which vanishes on the orbit of $P$ but not on the orbit of $Q$. The result follows.
