Let Y be a function of the random variable X as follows:
 $$ Y=
\left\{ 
 \begin{aligned}
 X, & \quad X\ge 0 \\ 
 X^2,& \quad X\le0
 \end{aligned}
\right.
 $$
compute $f\_{Y}{(y)}$ in terms of $f\_{X}{(x)}$, where $f\_{X}{(x)}=\frac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}x^2}$

I use total probability formula to derive an equation:
$$
P(Y\le y) =P(Y\le y | X \ge 0)P(X\ge 0) + P(Y\le y | X \le 0)P(X \le 0)
$$
Then:
$$
P(Y\le y) = P(X \le y | X \ge 0)P(X\ge 0) + P(X^2 \le y | X \le 0)P(X\le 0)
$$

Finally I derive cumulative distribution function $F\_{Y}{(y)}$, and obtain $f\_{Y}{(y)}$ from it.

However, my answer is not correct. I think the problem may lie in above two steps, so I was wondering if maybe anyone could point me out what is wrong with above two equitations?