$X$ and $Y$ are continuous random variables, and $Y=|X|$
I want to find $P(Y \leq y) = P(|X| \leq y)$
So I attempted the following
$$\begin{align*} P(|X| \leq y) & = P(|X|<y) && \text{ Since } X \text{ is a cont. r.v. } P(X=y)=0 \\ & = P(X<y)+P(X>-y) \end{align*}$$
However, my in my textbook's solution, $$P(|X| \leq y) = 1 - P(|X|>y) = 1 - (P(X>y)+P(X<-y))$$
I was wondering if these two equations are equal. If we rearrange my textbook's solution, $$\begin{align*} P(|X| \leq y) & = (1 - P(X>y)) - P(X<-y) \\ & = P(X<y)-P(X<-y) \end{align*}$$
Therefore, we check if $$P(X>-y) = -P(X<-y)$$
$-P(X<-y) = -(1 -P(X>-y)) = -1 + P(X>-y)$
We can see that $$-1+P(X>-y)\neq P(X>-y)$$
So I'm not sure if my calculations are wrong, but why does the book do $P(|X| \leq y) = 1 - P(|X|>y)$ instead of directly calculating $P(|X| \leq y) = P(X<y)+P(X>-y)$ and why are these approaches different?
Is it wrong that I assumed $P(|X| = y) = 0$?
Here is an easy way to solve the problem
$$F_Y(y)=\mathbb{P}[|X|\leq y]=\mathbb{P}[-y \leq X\leq y]=F_X(y)-F_X(-y)$$
Example:
Let $X\sim U[-1;1]$ . Find the distribution of $Y=|X|$
$$F_Y(y)=F_X(y)-F_X(-y)=\frac{y+1}{2}-\frac{1-y}{2}=y$$
Thus $Y\sim U[0;1]$
EDIT: answering to your comment,
$$\mathbb{P}[-y\leq X\leq y]=\underbrace{\mathbb{P}[-\infty\leq X\leq y]}_{=\mathbb{P}[X\leq y]=F_X(y)}-\underbrace{\mathbb{P}[-\infty\leq X\leq -y]}_{=\mathbb{P}[X\leq -y]=F_X(-y)}$$