Solution (source code)

= Solution

Set $F(z,w)=w^2-z^n+1$. Its complex <gradient> is $(-nz^{n-1},2w)$, never zero on $F=0$: simultaneous zero would give $z=w=0$, which is not on the <curve>. The complex <implicit function theorem> therefore gives a one-dimensional complex <manifold>, hence a <Riemann surface>. Where $w\ne0$ use $z$ as coordinate, and where $z\ne0$ use $w$; the transition maps and both projections are <holomorphic>.

For $\pi$, a <ramification point of a holomorphic map> has $w=0$ and $z=\zeta$ with $\zeta^n=1$. In the coordinate $w$, $z-\zeta=w^2/(n\zeta^{n-1})+O(w^4)$, giving <ramification index> $2$. Thus there are $n$ such points, and their <branch points> are the $n$th <roots of unity>.

For $\tau$, a <ramification point of a holomorphic map> has $z=0,w=\pm i$. In the coordinate $z$, $w-w_0=z^n/(2w_0)+O(z^{2n})$, giving <ramification index> $n$ at both points and <branch points> $\pm i$.

Write $n=2m$. At infinity set $u=1/z$, $v=w u^m$; then $v^2=1-u^n$. At $u=0$ there are two smooth points, $v=\pm1$, and $u$ is a local coordinate. The extended $\pi$ has a simple pole at each, so neither is ramified. The degree-two <Riemann-Hurwitz formula> for the map to the <Riemann sphere> gives $2g-2=2(-2)+n$, hence
$$
\boxed{g=\frac{n-2}{2}.}
$$
The list for $\tau$ above concerns the original affine <Riemann surface>; on the compactification its poles at the two added points have order $m$ and are additionally ramified if $m>1$.