The continuous random variable $X$ has a Uniform$[-1,3]$ distribution. Let $Y=X^2$
Find the probability density function of $Y$
Since $X^2$ is not monotonic, you can't use the Change of Variables theorem. Hence we split it into monotone pieces $x\in[-1,0]$ and $x \in [0,3]$. Thus, I tried using
$$f_Y(y) = f_X(-\sqrt{y}) \cdot |\frac{d}{dy}(-\sqrt{y})| + f_X(\sqrt{y}) \cdot |\frac{d}{dy}(\sqrt{y})|$$
$$= \frac{1}{3-(-1)} \cdot |\frac{-1}{2\sqrt{y}}| +\frac{1}{3-(-1)} \cdot |\frac{1}{2\sqrt{y}}|$$
$$= \frac{1}{4\sqrt{y}} \text{ if } 0 < y < 9 $$
But the answer is supposed to be
$\frac{1}{4\sqrt{y}} \text{ if } 0 < y < 1$
$\frac{1}{8 \sqrt{y}} \text{ if } 1 < y < 9$
$0 \quad \text{otherwise}$
Not sure where they got the second case from and why my answer does not match?
I think it is best if you work with CDFs as opposed to PDFs, as a general rule. Let $F_X$ be the cdf of $X$. Then we get that $F_X(x) = \int_{-1}^x\frac{1}{4}dt = \frac{1}{4}(x+1)$, for $x\in [-1,3]$.
$$ \begin{split}F_Y(y) &= P(Y\leq y) = P(X^2\leq y) = P\left(-\sqrt{y}\leq X\leq \sqrt{y}\right) = F_X\left(\sqrt{y}\right) -F_X\left(-\sqrt{y}\right)\\ &= \frac{1}{2}\sqrt{y} , \mbox{ if } y\in[0,1]\\ &= \frac{1}{4}(\sqrt{y}+1) , \mbox{ if } y\in(1,9]\end{split}$$
We get two separate cases because, if $y\in [0,1]$ then $X$ would be restricted as it needs to be larger than $-\sqrt{y}\geq -1$. Otherwise, if $y$ is in $(1,9]$ the restriction $X\geq - \sqrt{y}$ is redundant as $X\geq -1 >-\sqrt{y}$, hence no more second term.
I guess that is where your mistake was, also, you worked with the pdfs directly and it is much harder for you to spot the mistakes that way.