(a)
Let $a > 0$. With BC $h(\theta) = f(\theta)$. It was derived that by changing to polar coordinates $(x,y) \mapsto (r,\theta)$ has a solution of the form:
$$ u(r,\theta) = \frac{1}{2} A_0 + \sum_{n=1}^{\infty} r^n (A_n \cos(n \theta) + B_n \sin(n \theta)) $$
Differentiating this equation for $u(r,\theta)$ with respect to $r$ gives us our boundary condition at $r=a$, $f(\theta)$.
$$ u_{r}(r,\theta) = \sum_{n=1}^{\infty} n r^{n-1} (A_n \cos(n \theta) + B_n \sin(n \theta)) $$
$$ u_{r}(a,\theta) = \sum_{n=1}^{\infty} n a^{n-1} (A_n \cos(n \theta) + B_n \sin(n \theta)) = f(\theta) $$
$$ \text{Notice that: }\int_{0}^{2\pi}f(\theta) d \theta = \int_{0}^{\pi} \sin (\theta)d \theta + \int_{\pi}^{2\pi}0 d \theta = 1-1+0 = 0 $$
So $f$ has a free coefficient and we may find a unique solution up to a constant $C \in \mathbb{R}$. We have Fourier coefficients at $r = a$:
$$ A_n = \frac{1}{\pi n a^{n-1}} \int_{0}^{2\pi}h(\phi)\cos(n\phi)d\phi $$
$$ B_n = \frac{1}{\pi n a^{n-1}} \int_{0}^{2\pi}h(\phi)\sin(n\phi)d\phi $$
Substituting in $f(\theta)$ and splitting the integral between $(0,\pi)$ and $(\pi,2\pi)$:
$$ \implies A_n = \frac{1}{\pi n a^{n-1}} \int_{0}^{2\pi}f(\phi)\cos(n\phi)d\phi = \frac{1}{\pi n a^{n-1}}( \int_{0}^{\pi}\sin(\phi)\cos(n\phi)d\phi + \int_{\pi}^{2\pi}0\cos(n\phi)d\phi) $$
$$= \frac{1}{\pi n a^{n-1}}(\frac{-1-(-1)^n}{n^2-1}) \text{, as } n \in \mathbb{N}$$
and $A_0=0$
$$ \implies B_n = \frac{1}{\pi n a^{n-1}} \int_{0}^{2\pi}f(\phi)\sin(n\phi)d\phi = \frac{1}{\pi n a^{n-1}}( \int_{0}^{\pi}\
sin(\phi)\sin(n\phi)d\phi + \int_{\pi}^{2\pi}0\sin(n\phi)d\phi) $$
$$= \frac{1}{\pi n a^{n-1}}(0) = 0 \text{, as } n \in \mathbb{N}$$
$$ \implies u(r,\theta) = \sum_{n=1}^{\infty} (\frac{r^n}{a^{n-1}}) \frac{-1-(-1^2)}{ \pi (n^3-n) } \cos(n \theta) + C, \phantom{\ } C \in \mathbb{R} \phantom{\ } $$
(b)
Let $a >0$. BC $h(\theta) = f(\theta)$. $r\mapsto \frac{1}{r}$ : $\{ z : z \in \mathbb{R}_\infty , z \ge a \} \mapsto \{ \frac{1}{z} : \frac{1}{z} \in \mathbb{R}_{\infty} , \frac{1}{z} \le \frac{1}{a}\} $. Then $\frac{1}{r} \rightarrow 0$ as $r \rightarrow \infty$.
Now we have: $ \int_{0}^{2\pi}f(\theta) d \theta $ so our BC has a free coefficient, and the Neumann problem on the interior of the disk with BC: $\{u = h(\theta) : r = a\}$, $u(r,\theta)$ has a unique solution up to a constant $C \in \mathbb{R}$ of the form:
$$ u(r,\theta) = \sum_{n=1}^{\infty} r^n (A_n \cos(n \theta) + B_n \sin(n \theta)) + C $$
$$ A_n = \frac{1}{\pi n a^{n-1}} \int_{0}^{2\pi}h(\phi)\cos(n\phi)d\phi $$
$$ B_n = \frac{1}{\pi n a^{n-1}} \int_{0}^{2\pi}h(\phi)\sin(n\phi)d\phi $$
Mapping $\{r \mapsto \frac{1}{r}, a \mapsto \frac{1}{a}\}$ gives us the equivalent solution on the exterior:
$$ \implies u(r,\theta) = \sum_{n=1}^{\infty} r^{-n} (A_n \cos(n \theta) + B_n \sin(n \theta)) + C $$
BC at $\frac{1}{r} = \frac{1}{a}$, $u_r = f(\theta)$ so we have:
$$u_{r} = \sum_{n=1}^{\infty} (-n) r^{-n-1} (A_n \cos(n \theta) + B_n \sin(n \theta)) $$
$$u_{r} \bigr|_{\frac{1}{a}} = \sum_{n=1}^{\infty} (-n) a^{-n-1} (A_n \cos(n \theta) + B_n \sin(n \theta))= f(\theta) $$
we have Fourier coefficients:
$$ A_n = - \frac{1}{\pi n a^{-n-1}} \int_{0}^{2\pi}h(\phi)\cos(n\phi)d\phi $$
$$ B_n = - \frac{1}{\pi n a^{-n-1}} \int_{0}^{2\pi}h(\phi)\sin(n\phi)d\phi $$
Substituting in $f(\theta)$ and splitting the integral between $(0,\pi)$ and $(\pi,2\pi)$:
$$ \implies A_n = - \frac{1}{\pi n a^{-n-1}} \int_{0}^{2\pi}f(\phi)\cos(n\phi)d\phi = - \frac{1}{\pi n a^{-n-1}}( \int_{0}^{\pi}\sin(\phi)\cos(n\phi)d\phi + \int_{\pi}^{2\pi}0\cos(n\phi)d\phi) $$
$$= - \frac{1}{\pi n a^{-n-1}}( \frac{-1-(-1)^2}{n^2-1}) = 0 \text{, as } n \in \mathbb{N}$$
$$ \implies B_n = - \frac{1}{\pi n a^{-n-1}} \int_{0}^{2\pi}f(\phi)\sin(n\phi)d\phi = - \frac{1}{\pi n a^{-n-1}}( \int_{0}^{\pi}\sin(\phi)\sin(n\phi)d\phi + \int_{\pi}^{2\pi}0\sin(n\phi)d\phi) $$
$$= - \frac{1}{\pi n a^{-n-1}}(0) = 0 \text{, as } n \in \mathbb{N}$$
$$ \implies u(r,\theta) = \sum_{n=1}^{\infty} (\frac{a^{n+1}}{r^n}) \frac{-1-(-1)^2}{ \pi (n^3-n) } \cos(n \theta) + C, \phantom{\ } C \in \mathbb{R} \phantom{\ } $$