The question is: Suppose $X$ has uniform $[-1,2]$ distribution. Find the density of $X^2$.
The range is $(0, 4)$, but it's $g(-1) = 1$ and $g(2) = 4$, so I don't get why it's $(0, 4)$
Also, the solution says this:
For (0,1), $\frac{1/3+1/3}{2\sqrt{y}}$
For (1,4), $\frac{1/3+0}{2\sqrt{y}}$
Why is it split at 1, and how come $(0,1)$ is $1/3+1/3$ and (1,4) is $1/3+0$?
The range of $g$ is $(\min g(x), \max g(x))$, not $(g(\min x), g(\max x))$. In other words, while $g(-1)=(-1)^2=1$, $g(0)=0^2=0<1$ is the minimum of $g(x)=x^2$ on the range $(-1,2)$.
The density function is split in two parts for the same reason, $\forall a\in (0,1)\implies a^2\in (0,1), X=a$ and $X=-a$ both map to $X^2=a^2$, which means the density of $X^2$ is doubled on $(0,1)$