<s>[INST] $X$ has pdf $f(x)=c(x+1)$ Find pdf of $Y=X^2$. 
Let $X$ be  continuous random variable with pdf $f(x)=c(x+1)$ for
$-2<x<1$. Determine the pdf of $Y=X^2$.

I actually asked this question earlier but the second part of the question didn't make sense. I just wanted to verify if my solution for this question is correct.
$\int_{-2}^{1} c(x+1)dx=\frac{3}{2}c$
$c=\frac{2}{3}$
For $0<y<1$
$$P(X\leq \sqrt{y})=\int_{-\sqrt{y}}^{\sqrt{y}} 2/3 (x+1)dx=\frac{4\sqrt{y}}{3}$$
Taking the derivative, I get
$f_{y}(y)=\frac{2}{3\sqrt{y}}, 0<y<1$
Similarly, for $1<y<4$  the cdf is
$$\int_{-2}^{\sqrt{y}} 2/3(x+1)dx = \frac{y}{3}+2\sqrt{y}$$
Again, taking the derivative I get
$f_y(y)=\frac{1}{3}+\frac{1}{\sqrt{y}}$
So finally:
$$f_Y(y) =
\begin{cases}
\frac{2}{3\sqrt{y}},  & \text{0<y<1} \\[2ex]
\frac{1}{3}+\frac{1}{\sqrt{y}}, & \text{1<y<4}
\end{cases}$$
 [/INST] As @Alex said, $c(x+1)$ becomes both negative, positive value on $-2 < x < 1$, which makes $f$ not a pdf.
To make $f$ a pdf, you should separate $c$ within the range with proper $c$'s.
i.e. $c_1(x+1)$ in ($-2 < x < -1$), $c_2(x+1)$ in ($-1 < x < 1$)

Let's ignore the negative value problem and consider the integration parts.
Let's keep in mind that the support of $x$ is $(-2, 1)$
\begin{align}
 F_Y(y) &= P(Y \leq y) \\
&=  P(X^2\leq y)\\
&= P(- \sqrt y  \leq X \leq \sqrt y)
\end{align}
For $0 < y < 1$,
\begin{align}
-1 < - \sqrt y \leq X \leq \sqrt y < 1
\end{align}
So, the interval is contained in the support.
Thus,
\begin{align}
F_Y(y) = \int_{-\sqrt y}^{\sqrt y} f_X(x)  dx
\end{align}
For $1 < y < 4$,
\begin{align}
1 < \sqrt y < 2 \text{  and} -2< -\sqrt y < -1 \\ 
\end{align}
\begin{align}
-2 < -\sqrt y \leq X < 1 < \sqrt y < 2
\end{align}
So, the interval $[- \sqrt y, \sqrt y]$ is not contained in the support.
Thus, we should get the intersection of $[- \sqrt y, \sqrt y]$ and support(=$(-2, 1)$) as integration interval which is
\begin{align}
[- \sqrt y, 1)
\end{align}
Thus,
\begin{align}
F_Y(y) = \int_{-\sqrt y}^{1} f_X(x)  dx
\end{align}
</s>