Find transformation function when densities are known I need some help with the following probability/statistics problem: Let X be a continuous random variable with density $f_{X}(x) =
\begin{cases}
\mathrm{e}^{-x^{2}} & \text{}x\text{ > 0} \\
0 & \text{}\text{elsewhere}
\end{cases}$. Find the tranformation function $g$ such that the density of $Y=g(X)$ is $$f_{Y}(y) =
\begin{cases}
{\frac{1}{2\sqrt{y}}} & \text{}0\text{ < y < 1} \\
0 & \text{}\text{elsewhere}
\end{cases}$$Any help would be much appreciated.
 A: 
Find the tranformation function $g$ such that the density of $Y=g(X)$ is...

Assume that $Y=g(X)$ and that $g$ is increasing, then the change of variable theorem yields 
$$
g'(x)f_Y(g(x))=f_X(x).
$$
In the present case, one asks that, for every positive $x$,
$$
\frac{g'(x)}{2\sqrt{g(x)}}=2x\mathrm e^{-x^2},
$$
thus,
$$
g(x)=(c-\mathrm e^{-x^2})^2.
$$
Since $g$ sends $(0,+\infty)$ to $(0,1)$, one gets $c=1$ and a solution is
$$
Y=(1-\mathrm e^{-X^2})^2.
$$
Assuming instead that $g$ is decreasing, one gets 
$$
g'(x)f_Y(g(x))=-f_X(x),
$$ 
hence
$$
g(x)=(c+\mathrm e^{-x^2})^2,
$$
and the same argument shows that $c=1$ hence another solution is
$$
Y=\mathrm e^{-2X^2}.
$$
This new solution should not come as a surprise since $1-\mathrm e^{-X^2}$ and $\mathrm e^{-X^2}$ are both uniformly distributed on $(0,1)$ and the density of $Y$ is nothing but the density of the square of a uniform random variable on $(0,1)$. 
Actually, there exists tons of different functions $g$ such that $Y=g(X)$ has the desired distribution hence the order to "Find the tranformation function such that..." is odd.
