Help with exercise in complex analysis on the existence of a mapping I have encountered the following exercise from a practice exam:

Does there exist an analytic function mapping the annulus:
$ A = \{ z | 1 \leq |z| \leq 4 \} $
onto the annulus:
$ B = \{ z | 1 \leq |z| \leq 2 \} $
And which takes $ C_1 \to C_1 $ and $ C_4 \to C_2 $ where $ C_r $ is the circle centered at the origin with radius $ r $.

I have no clue how to approach this. Perhaps if I assume such a function exists I can reach a contradiction but how to do this? Or perhaps such a function exists and I cannot think of it? I appreciate all help on this.
 A: The answer is no because the function would (essentially) need to be $\sqrt z$ and that is not globally defined in the annulus.
To prove this just let $u(z)=2\log |f| - \log |z|$ harmonic and zero on the boundary so $u(z)=0$ hence $2\log |f|= \log |z|$
But now using a local holomorphic logarithm $h_w(z)= \log f(z)$ around any point $w \in A$ one gets that $|\frac{e^{2h_w(z)}}{z}|=1$ so $e^{2h_w(z)}=\alpha_wz, |\alpha_w|=1$ and logarithmic differentiation gives $(2f'/f)(z)=1/z$ which holds in all of $A$ as the dependence on $w$ vanishes.
Integrating on a circle of radius in-between $1$ and $4$ leads to the contradiction $2k=1$ for some integer $k$. Done!
(edit later - note that the same proof shows more generally that a (holomorphic) map from annulus $(1,R_1)$ to annulus $(1,R_2), 1 < R_1, R_2$ that takes distinct boundary circle to distinct boundary circles exists iff $R_2=R_1^k, k$ integral so for example $z^2$ takes $B$ to $A$ in the OP notations - the only thing to add is that if the map inverts circles (takes $1$ to $R_2$) then compose it with an annulus inversion and then if $R_2=R_1^a, a>0$ the proof above with $a$ instead of $1/2$ shows that $k/a=1$ for some positive integer $k$)
