$f$ is analytic on $\mathbb{D}$ and doesn't have zero points, then $\exists g$ on $\mathbb{D}$ s.t. $\forall x\in(-1,1), g(x)=|f(x)|$ Problem:
Prove that if $f(z)$ is analytic on $\mathbb{D}$ and doesn't have zero points, then $\exists g(z)$ (which is also analytic) on $\mathbb{D}$, s.t. $\forall x\in(-1,1), g(x)=|f(x)|$. Here $\mathbb{D}$ is the unit disk.
My attempt:
Let $g(z)=\sqrt{f(z)\overline{f(\bar{z})}}$. Obviously $\forall x\in(-1,1), g(x)=|f(x)|$. 
What I need to do is to prove $\sqrt{f(z)\overline{f(\bar{z})}}$ can get a single valued holomorphic branch. But I don't know how to prove it. Can you give some help?
 A: $\mathbb{D}$ is a simply connected domain, even a convex one. So every holomorphic function in $\mathbb{D}$ has a primitive. So now assume $f$ is holomorphic in $\mathbb{D}$ without zeros. Then $\frac{f'}{f}$ is holomorphic as well and so has a primitive. It's not difficult to prove that this primitive has to be a branch of $\log(f)$. And a branch of $\log(f)$ gives a branch of $\sqrt{f}$, just define $\sqrt{f}=e^{\frac{1}{2}\log(f)}$. 
So now use it in your exercise. The function $f(z)\overline{f(\overline{z})}$ is holomorphic in $\mathbb{D}$ and has no zeros. 
A: The map $g(z)=f(z)\overline{f\left(\overline z\right)}$ is analytic and $\mathbb D$ is simply connected. Therefore, $g$ as an analytic square root in $\mathbb D$.
Since $f$ has no zeros, then neither has $g$. So, since $g(x)\in\mathbb R$ for each $x\in(-1,1)$ and $g$ is continuous, then you either always have $g(x)>0$ or you always have $g(x)<0$. Then $g$ is an answer to your problem in the first case; otherwise, take $-g$ instead.
