Characterization of Harmonic Functions on the Punctured Disk
Solution 1:
You know that a harmonic function has a conjugate in a simply connected domain. But $D\setminus \{0\}$ is not simply connected. Solution: use its universal cover, which is conveniently realized as the left half-plane $H$. Namely, $\exp:H\to D\setminus\{0\}$ is a holomorphic covering map.
The composition $u=h\circ \exp$ is a harmonic $2\pi i $-periodic function in $H$. Since $H$ is simply-connected, has a harmonic conjugate $v$. If $v$ is also $2\pi i$-periodic, we can grab $u+iv$ and jump right back to the disk. But in general it's not. In general, from $u(z)=u(z+2\pi i)$ we get $\nabla v(z)=\nabla v(z+2\pi i)$ which implies that $v(z+2\pi i)-v(z)$ is a constant. Let $c$ be this constant.
Define $g(z) = u(z)+iv(z)-\frac{c}{2\pi }z$; this is constructed so that $g$ is $2\pi i$-periodic. Therefore, $g\circ \log $ is a well-defined holomorphic function in $D\setminus\{0\}$. This is $f$ that you are looking for. The difference between $\mathrm{Re}\,f$ and $h$ comes from $\mathrm{Re}\,\left(\frac{c}{2\pi }\log z\right)$, and this is the multiple of $\log|z|$ that you see in the statement of the problem.