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?
$\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.