Solution (source code)

= Solution

Because $h'(x)=-g(x)/x$, the joint density from part (b) can be written
$$
f_{Y,Z}(y,z)=-h'(y+z).
$$
The pieces are therefore independent if and only if
$$
\boxed{-h'(y+z)=h(y)h(z)\quad(y,z\geq0)}.
$$
This condition is also sufficient because $h$ is the common marginal density.

Set $c=h(0)$. Taking $z=0$ gives the differential equation
$$
h'(y)=-c\,h(y).
$$
Since $h$ is a probability density, $c$ must be positive, and normalization gives
$$
\boxed{h(y)=ce^{-cy}\mathbf 1_{\{y\geq0\}}}.
$$
Conversely this function satisfies the displayed factorization. Thus the <exponential characterization by a uniform random split> shows that
$$
\boxed{Y,Z\text{ are independent }\operatorname{Exp}(c)\text{ variables}}.
$$
Equivalently, $g(x)=-xh'(x)=c^2xe^{-cx}$, so $X$ has the gamma distribution with shape two and rate $c$.