$X \sim U [-0.5 , 1.5] , Y = X^2$ Given $$ f(x) = \begin{cases} \frac12 &,\ -0.5 \le x\le 1.5\\0 &,\ \mbox{otherwise} \end{cases}$$
find the probability density function of $Y=X^2$.
To solve this I first divided up the pdf of X into three parts:
$$f(x) = \begin{cases} \frac12 &, \ -0.5 \le x\le 0\\\frac12 &, \ 0\le x\le 0.5 \\ \frac12 &,\ 0.5 \le x\le 1.5\\ 0 &, \ \mbox{otherwise} \end{cases}$$
Then applying $g^{-1}(y) = -\sqrt{y}$ for $-0.5 \le x \le 0 $ and $g^{-1}(y) = +\sqrt{y}$ for $ 0 \le x \le 0.5 $ and $ 0.5 \le x \le 1.5 $, I get:
$$ g(y) = \begin{cases} \frac{1}{4\sqrt{y}} &,\ 0 \le x \le 0.25\\ \frac{1}{4\sqrt{y}} &, \ 0\le x\le 0.25 \\ \frac{1}{4\sqrt{y}} &, \ 0.25 \le x \le 2.25 \\ 0 &, \ \mbox{otherwise} \end{cases}$$
Summing up the first two cases I get:
$$ g(y) = \begin{cases} \frac{1}{2\sqrt{y}} &, \ 0 \le x \le 0.25 \\ \frac{1}{4\sqrt{y}} &, \ 0.25 \le x \le 2.25\\ 0 &, \ \mbox{otherwise} \end{cases} $$
Could someone confirm whether my solution is correct or not? And whether my argumentation makes sense? Thanks!
 A: It looks fine.  However, for future reference, I highly recommend the following method: find the cdf of $X$, find the cdf of $Y$, differentiate the cdf to get back your pdf for $Y$.  The steps for this problem would be as follows:
For $x<.5$, the cdf comes out to zero, and for $x>1.5$, it comes out to $1$.  For the values in between, we have
$$
cdf_x=P(X<x)=\int_{-0.5}^{x}f(x)\,dx=\frac12(x+0.5)=\frac x2 + 0.25
$$
Now for y, we can say $cdf_y=P(X^2<y)=cdf_x(\sqrt{y})-cdf_x(-\sqrt{y})$.  Long story short, we end up with
$$
cdf_y=
\begin{cases}
0 & y<0\\
\sqrt{y} & 0≤y≤0.25\\
0.25+\frac12 \sqrt{y} & 0.25≤y≤2.25\\
1 & y≥2.25
\end{cases}
$$
Differentiating, we find
$$
pdf_y=\frac{d}{dy}cdf_y=
\begin{cases}
0 & y<0\\
\frac1{2\sqrt{y}} & 0≤y≤0.25\\
\frac1{4\sqrt{y}} & 0.25≤y≤2.25\\
0 & y≥2.25
\end{cases}
$$
As you found.
(While in this case the work amounted to the same, this is a favorite method of mine because it works when the way in which you should deal with the multiple inverses isn't necessarily obvious).
