= Solution
In local coordinates around $p\in R$ and $f(p)\in S$, a nonconstant analytic map has the form
$$
f(z)-f(p)=z^m h(z),\qquad h(0)\ne0.
$$
After shrinking the chart, $h$ has an analytic $m$th root, so a change of coordinate makes the map $z\mapsto z^m$. It maps small discs onto neighborhoods of the origin; hence every nonconstant analytic map of Riemann surfaces is open. If $R$ is compact and $S$ connected, $f(R)$ is compact and therefore closed, and it is also nonempty and open. Thus $f(R)=S$.
For $f:\mathbb D\to\mathbb D$ with $f(0)=0$, the removable-singularity theorem makes $g=f/z$ analytic. On $|z|=r$, $|g(z)|=|f(z)|/r\leq1/r$, and the maximum principle gives the same bound throughout $\mathbb D_r$. Applying the <Schwarz lemma> to an automorphism $h$ and to $h^{-1}$ shows that every automorphism fixing zero is
$$
h(z)=e^{i\theta}z.
$$
If $F:\mathbb C\to\mathbb C$ is an analytic isomorphism fixing zero, continuity of $F^{-1}$ implies that the preimage of every closed disc is compact. Hence $|F(z)|\to\infty$ as $|z|\to\infty$, and defining $F(\infty)=\infty$ gives an analytic isomorphism of the Riemann sphere.
Consequently an automorphism of $\mathbb D$ fixing zero does extend to $\mathbb C$. A general disc automorphism need not: for $a\ne0$,
$$
\frac{z-a}{1-\bar a z}
$$
has a finite pole and cannot extend to an entire isomorphism.
Back to article page