The problem is :
Let $f(x) = {1\over 3} , -1<x<2 $, zero elsewhere, be the pdf of $X$. Find the cdf and pdf of $Y=X^2$.
The answer is:
Consider case 1: When $ 0<y<1 $
$P(X^2\le y) =P(-\sqrt{y} \le x \le \sqrt{y}) = \int_{-\sqrt{y}}^{\sqrt{y}}\,{1\over 3}dx = {2\sqrt{y}\over 3}$
Consider case 2: When $ 1\le y \le4 $
$P(X^2\le y) =P( X^2 \le 1) + P( 1 \le X^2 \le y) = P( x \le 1) + P( 1 < x \le \sqrt{y}) = {2\over 3} + \int_{1}^{\sqrt{y}}\, {1\over 3} dx = {1\over 3}+{\sqrt{y}\over3} $
Therefore, $f_{Y}(y) = \begin{cases} {1\over 3\sqrt{y}}, & \text{$0<y<1$} \\ {1\over 6\sqrt{y}}, & \text{$1\le y \le4$} \\ {0}, & \text{otherwise} \end{cases} $
My questions:
(1)When encountering this kind of not one-to-one function, how to determine the intervals for $y$ ?
(2)How to determine the number of partition of the interval? Like this case, 2 intervals.
(3)Is there any way I can draw a graph to figure out the answers?
(4)If possible, can someone please give me some related practice questions? Since my text book contains only one not one-to-one transformation function problem.
Comment: It seems you have done everything correctly. Perhaps the following simulation will help with part (3). In R statistical software, I simulated 100,000 iterations of $X \sim Unif(-1, 2)$ and found $Y = X^2$ for each. Then made a histogram of the simulated distribution of $Y$, plotted your density curve through the histogram as a check; and plotted values of $Y$ against values of $X,$ to make a 'curve' consisting of 100,000 points.