Solution (source code)

= Solution

The set $D$ is star-shaped with centre $z_0$: if $z\in D$, every point of $[z_0,z]$ has its segment to $z_0$ contained in the same segment and therefore avoids the origin. Applying part (a) and the stated triangular-integral fact to $1/z$ gives a holomorphic function
$$
G(z)=\int_{[z_0,z]}\frac{d\zeta}{\zeta},
\qquad
G'(z)=\frac1z,\quad G(z_0)=0.
$$
Choose either square root $c$ of $z_0$ and define
$$
h(z)=c\,e^{G(z)/2}.
$$
Then $h$ is holomorphic. Moreover,
$$
\frac d{dz}\left(\frac{h(z)^2}{z}\right)=0,
$$
and its value at $z_0$ is one. Hence
$$
\boxed{h(z)^2=z\quad(z\in D)}.
$$