Hartshorne Chapter IV Exercise 5.2 If $X$ is a curve of genus $ \geq 2$ over a field of characteristic $0$, show that the group $\operatorname{Aut} X$ of automorphisms of $X$ is finite.
Hint: If $X$ is hyperelliptic, use the unique $g_1^2$ and show that $\operatorname{Aut} X$ permutes the ramification points of the $2$-fold covering $X \to \mathbb{P}^1$. If $X$ is not hyperelliptic, show that $\operatorname{Aut} X$ permutes the hyperosculation points of the canonical embedding.
I have a proof in the case that $X$ is hyperelliptic, but as I am not very familiar with hyperosculation points, I am struggling to prove the non-hyperelliptic case.
Could anyone give me a hint regarding that?

When $X$ is not hyperelliptic, $|K|$ is very ample and therefore embeds $X$ in to $\Bbb P^{g-1}$ as a curve of degree $2g-2$. The hyperosculation points of this embedding are exactly the points $P\in X$ with a global section $s\in\Omega_X(X)$ so that $s$ vanishes to order at least $g$ at $P$. Since $\Omega_X$ is preserved by any automorphism, we see that this condition is preserved by automorphisms and so $\operatorname{Aut} X$ acts on the set of hyperosculation points. Since there are $n(n+1)(g-1)+(n+1)d=g^3-g$ hyperosculation points in characteristic zero by exercise IV.4.6, all we need to do is to show the kernel of this map is finite in order to show $\operatorname{Aut} X$ is finite. In fact, we'll show that the kernel is trivial by showing that automorphism of a genus $g$ curve fixing more than $2g+2$ points is trivial. This proves the claim because $g^3-g>2g+2$ for $g>2$ (all curves of genus 2 are hyperelliptic anyways, so the only time we'd use the hyperosculation points is when $g>2$).
To show that a nontrivial automorphism $\sigma$ of a curve $X$ of genus $g$ has at most $2g+2$ fixed points, I claim that given a nontrivial automorphism $\sigma$, we can always find a nonconstant rational function $f\in K(X)$ with at most $g+1$ poles (counted with multiplicity) so that $f-\sigma f$ is not constant. Then $f-\sigma f$ has zeroes at every fixed point of $\sigma$, and $f-\sigma f$ has at most $2g+2$ poles because each of $f$ and $\sigma f$ have at most $g+1$ poles. As the number of poles and zeroes of any nonconstant rational function on a curve are equal (they're both equal to the degree of the map to $\Bbb P^1$ given by $f$), this proves that $\sigma$ has at most $2g+2$ fixed points.
First, for any effective divisor of degree $g+1$, we can find a nonconstant function with poles contained in $D$: by Riemann-Roch, $l(D)-l(K-D)=g+1-g+1=2$, so $l(D)\geq 2$, and therefore $l(D)$ contains a nonconstant rational function. Next, we can always find a degree $g+1$ effective divisor which isn't fixed by $\sigma$: just pick some point $x\in X$ not fixed by $\sigma$ (which we can always find because $\sigma$ is not the identity) and look at $(g+1)x$. So $(f-\sigma f)_\infty$ is of degree at most $2g+2$ and therefore $(f-\sigma f)_0$ is of degree at most $2g+2$ and therefore can contain at most $2g+2$ points, and we've won.
