$f$ is analytic, nonzero on simply connected domain. Show that $\log|f(z)|$ is harmonic. $f$ is analytic, nonzero on a simply connected domain $\Omega \subset \Bbb C$.  Show that $\log|f(z)|$ is harmonic on $\Omega$.
I thought of two methods:


*

*$f=u+iv$ so $\log|f(z)|=\log\sqrt{u^2+v^2}$ , then use the definition of harmonic to solve it, i.e. $U_{xx}+U_{yy}=0$.

*$f$ can be wrote as something related to $\log|f(z)|+i\arg(f(z))$, but how to continue?

 A: Suppose we write $f(z)$ in polar form, that is
$f(z) = \vert f(z) \vert e^{i \arg(f(z))}; \tag 1$
if we set
$g(z) = \ln (\vert f(z) \vert) + i\arg(f(z)), \tag 2$
then
$e^{g(z)} = e^{ \ln (\vert f(z) \vert) + i\arg(f(z))} = e^{\ln(\vert f(z) \vert} e^{i\arg(f(z))} = \vert f(z) \vert e^{i\arg(f(z))} = f(z). \tag 3$
Now let $z_0 \in \Omega$ and consider the function
$F(z) = \displaystyle \int_{z_0}^z \dfrac{f'(s)}{f(s)}ds; \tag 4$
since $f(z)$ is holomorphic in $\Omega$, so is $f'(z)$, and since $f(z) \ne 0$ in $\Omega$, $f'(z)/ f(z)$ is a well -defined holomorphic function on this domain; furthermore, since $\Omega$ is simply connected, the integral (4) defining $F(z)$ is completely independent of the path along which is taken, just so that path remains in $\Omega$. (Simple connectedness implies that an integral of a holomorphic function over any closed path vanishes, which in turn implies that any two path integrals (of the same holomorphic function) 'twixt the same endpoints are equal.  These are standard facts upon which the theory of holomorphic functions is built; they occur in many texts on the subject.)  Thus $F(z)$ is a well-defined holomorphic function on $\Omega$.  Now
$((f(z))^{-1}e^{F(z)})' = -(f(z))^{-2}f'(z)e^{F(z )} + (f(z))^{-1}(e^{F(z)})'$
$= -(f(z))^{-2}f'(z)e^{F(z )} + (f(z))^{-1}\dfrac{f'(z)}{f(z)} e^{F(z)} = 0; \tag 5$
thus
$(f(z))^{-1}e^{F(z)} = c, \tag 6$
a constant, whence
$e^{F(z)} = cf(z); \tag 7$
since $F(z_0) = 0$, 
$cf(z_0) = e^{F(z_0)} = e^0 = 1, \tag 8$
whence
$c = (f(z_0))^{-1}, \tag 9$
leading via (7) to 
$f(z) = f(z_0)e^{F(z)}; \tag {10}$
using (3), (10) becomes
$e^{g(z)} = e^{g(z_0)}e^{F(z)} = e^{g(z_0) + F(z)}, \tag{11}$
whence
$e^{g(z) - g(z_0) - F(z)} = 1, \tag{12}$
so 
$g(z) - g(z_0) - F(z) = 2n\pi i \tag{13}$
for some $n \in \Bbb Z$; now taking $z = z_0$ in (13) yields, since $F(z_0) = 0$, 
$2n\pi i = g(z_0) - g(z_0) = 0, \tag{14}$
whence $n = 0$ and
$g(z) = g(z_0) + F(z). \tag{15}$
In light of (2), this yields
$\ln (\vert f(z) \vert) + i \arg(f(z)) = g(z_0) + F(z), \tag{16}$
which implies that $\ln (\vert f(z) \vert) + i \arg(f(z))$ is holomorphic; thus both $\ln (\vert f(z) \vert)$ and $\arg(f(z))$ are harmonic, and are in fact harmonic conjugates of one another.
Note: This question generalizes 
Finding Harmonic conjugate for $\arg(z)$
End of Note.
A: First, the question of whether a function is harmonic (or not) is purely local, so we do not need to worry about branches, etc. That is, it suffices to take a small disc around a point where $f(z)\not=0$.
Then your first idea would work, using the fact that the real and imaginary parts satisfy the Cauchy-Riemann equations.
A cuter argument (which in reality just amounts to a hidden discussion of the Cauchy-Riemann equations) is to write $2\log |f(z)|=\log f(z)+\log \overline{f(z)}$, and use the idea that the Laplacian is ${\partial\over \partial z}\circ {\partial\over \partial \overline{z}}$. Since $\log f(z)$ is annihilated by $\partial/\partial \overline{z}$, and $\log \overline{f}(z)$ by $\partial /\partial z$, the sum is annihilated by the composition.
A: Let $a\in U,$ where $U$ is the domain of $f.$ Since $f(a)\ne 0,$ there is an open disc $D(f(a),r)$ that does not contain $0.$ This implies there exists a ray from the origin that misses this disc. Hence a branch of $\log z,$ which I'll just denote by $ \log z,$ is holomorphic in $D(f(a),r)$. It follows that $\log f$ is holomorphic in $f^{-1}(D(f(a),r)),$ which is an open subset of $U$ containing $a.$ The real part of $\log f,$ which is $\ln |f|,$ is therefore harmonic in $f^{-1}(D(f(a),r)).$ We are done, because harmonicity is a local property. (Note that the simple connectivity of $U$ is not needed.) 
