Find PDF of $Y = |X|$ if $X$ is a random variable following the normal distribution
so I have a $X$ random variable, with a PDF that follows the normal distribution $X \sim N(0,1)$ so $f_X(x) = \frac{1}{\sqrt (2\pi)}e^{\frac{-x^2}{2}}$. I now have to compute the PDF of the random variable $Y = |X|$.
I started by: $F_Y(y) = \mathbb{P}(Y \leq y) = \mathbb{P}(|X| \leq y) = \mathbb{P}( -y \leq X \leq y) = F_X(y) - F_X(-y) \Rightarrow f_Y(y) = \frac{dF_Y(y)}{dy} = \\ f_X(y)\frac{dy}{dy}-f_X(-y)|\frac{d(-y)}{dy}|$.
Is it correct to put absolute values there, or should I let the negative sign affect the sign of f_X(-y)? My teacher used to put absolute values there, but never talked about why that's useful. I could gladly use an explanation!
If I continue this way I end up with: $\frac{1}{\sqrt (2\pi)}e^{\frac{-y^2}{2}} - \frac{1}{\sqrt (2\pi)}e^{\frac{-(-y)^2}{2}} = 0$ and I don't know if what I am doing is right. Thanks =)
Is it correct to put absolute values there,
No, it is not quite correct. You let the negations cancel to give you:
$$\begin{align}f_Y(y) &= ( f_X(y) - f_X(-y)\,(-1)) ~\mathbf 1_{0\leqslant y}\\[2ex] &= ( f_X(y) + f_X(-y)) ~\mathbf 1_{0\leqslant y}\\[2ex]&=2~f_X(y)~\mathbf 1_{0\leqslant y}\end{align}$$
Which should make sense, since the support for $f_X$ is folded along the distribution's point of symmetry. You should anticipate that the density of $Y$ will be twice that of $X$ everywhere in that folded support.
teacher used to put absolute values there, but never talked about why that's useful.
There is a rigorous explanation ...but, basically... it's a cheat. By always adding unsigned derivatives of the cummulative distribution from each fold, you don't have to worry about determining the direction of those folds. You ensure all negatives cancel where the need to, so the density is always non-negative.