<s>[INST] deriving pdf with two methods, with two different results I have this problem to determine a density function $f_{Y}(y)$ of $Y$ given $X$ as a random variable with uniform distribution on $[−1, 1]$ and $Y = X^2$. So: $f_X(x) = \frac{1}{2}$ for $x \in [-1, 1]$. I approached this problem with two different ways, 1) through determining first the $F_Y$ as the $CDF$, then derive from it $PDF$ 2) by transformation.
For the first method I got $f_Y(y) =  \frac{1}{2\sqrt(y)}$ for $y \in ]0, 1]$ This seems correct. However, for transformation method, I tried the following:
$g(x) = x^2$ and $g'(x) = 2x$
$x_1 = g^{-1}(y) = \sqrt(y)$
so $f_Y(y) = \frac{f_X(x_1)}{|g'(x_1)|} = \frac{1/2}{2\sqrt(y)} = \frac{1}{4\sqrt(y)}$
Also, there is the example of $Y = X^3$, then:
$g(x) = x^3$ and $g'(x) = 3x^2$
$x_1 = g^{-1}(y) = \sqrt[3](y)$
so $f_Y(y) = \frac{f_X(x_1)}{|g'(x_1)|} = \frac{1/2}{3\sqrt[3](y)^2} = \frac{1}{6\sqrt(y)^2}$ but the correct answer is $\frac{1}{3\sqrt(y)^2}$
 [/INST] This idea that you proposed only works if the transform $g(\cdot)$ is one to one.
https://www.math.arizona.edu/~jwatkins/f-transform.pdf
This is why the following reasoning is incorrect, for instance, if $g(x)=x^2$
\begin{align}
f_Y(y)&=f_X(g^{-1}(y))\Big| \frac{d}{dy}g^{-1}(y) \Big|  \\
&= \frac{1}{2} \Big| \frac{1}{2} y^{-1/2} \Big| 
\end{align}
The correct would be
\begin{align}
F_Y(y) &= P(Y \leq y) = F_X(\sqrt{y})- F_X(-\sqrt{y}) \\
f_Y(y)&= \frac{1}{2\sqrt{y}}(f_X(\sqrt{y})+f_X(-\sqrt{y})) = \frac{1}{2\sqrt{y}}
\end{align}
</s>