(a)
Take $r \ge 0$. Let $a >0$. $(x,y) \mapsto (r,\theta)$ with Dirichlet BC: $\{u = h(\theta) : r = a\}$, $u(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)) $$
$$ A_n = \frac{1}{\pi a^n} \int_{0}^{2\pi}h(\phi)\cos(n\phi)d\phi $$
$$ B_n = \frac{1}{\pi a^n} \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 a^n} \int_{0}^{2\pi}f(\phi)\cos(n\phi)d\phi = \frac{1}{\pi a^n}( \int_{0}^{\pi}\sin(\phi)\cos(n\phi)d\phi + \int_{\pi}^{2\pi}0\cos(n\phi)d\phi) $$
$$= \frac{1}{\pi a^n}( \frac{-(-1)^n-1}{n^2-1}) \text{, as } n \in \mathbb{N}$$
$$A_0=\frac{-(-1)^0-1}{\pi a^0(0-1)}=\frac{2}{\pi}$$
$$ \implies B_n = \frac{1}{\pi a^n} \int_{0}^{2\pi}f(\phi)\sin(n\phi)d\phi = \frac{1}{\pi a^n}( \int_{0}^{\pi}\sin(\phi)\sin(n\phi)d\phi + \int_{\pi}^{2\pi}0\sin(n\phi)d\phi) $$
$$= \frac{1}{\pi a^n}( 0) = 0 ; \text{, as } n \in \mathbb{N}$$
$$ \implies u(r,\theta) =\frac{1}{\pi} + \sum_{n=1}^{\infty} (\frac{r}{a})^n \frac{-1-(-1)^n}{(n^2-1) \pi } \cos(n \theta) \phantom{\ } $$
For $n=2m-1$,$m=1,2,3,...$ as 'odd' coefficients are 0.
(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$.
BC: $\{u = h(\theta) : r = a\}$, $u(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)) $$
$$ A_n = \frac{1}{\pi a^n} \int_{0}^{2\pi}h(\phi)\cos(n\phi)d\phi $$
$$ B_n = \frac{1}{\pi a^n} \int_{0}^{2\pi}h(\phi)\sin(n\phi)d\phi $$
Substituting in $f(\theta)$, mapping $\{r \mapsto \frac{1}{r}, a \mapsto \frac{1}{a}\}$, and splitting the integral between $(0,\pi)$ and $(\pi,2\pi)$, gives us the solution on the exterior:
$$ \implies u(r,\theta) = \frac{1}{2} A_0 + \sum_{n=1}^{\infty} r^{-n} (A_n \cos(n \theta) + B_n \sin(n \theta)) $$
$$ \implies A_n = \frac{1}{\pi a^{-n}} \int_{0}^{2\pi}f(\phi)\cos(n\phi)d\phi = \frac{a^{n}}{\pi }( \int_{0}^{\pi}\sin(\phi)\cos(n\phi)d\phi + \int_{\pi}^{2\pi}0\cos(n\phi)d\phi) $$
$$= \frac{a^{n}}{\pi}( \frac{-1-(-1)^n}{(n^2-1) \pi}) \text{, as } n \in \mathbb{N}$$
so we have::
$$A_0=\frac{2}{\pi}$$
$$ \implies B_n = \frac{1}{\pi a^{-n}} \int_{0}^{2\pi}f(\phi)\sin(n\phi)d\phi = \frac{a^{n}}{\pi }( \int_{0}^{\pi}\sin(\phi)\sin(n\phi)d\phi + \int_{\pi}^{2\pi}0\sin(n\phi)d\phi) $$
$$= \frac{a^{n}}{\pi }(0) =0 \text{, as } n \in \mathbb{N}$$
$$ \implies u(r,\theta) = \frac{1}{\pi}+\sum_{n=1}^{\infty} (\frac{a}{r})^n \frac{-1-(-1^n)}{(n^2-1) \pi } \cos(n \theta) \phantom{\ } $$