This is a question that a friend asked me (has the final answer too).
The pdf of a random variable $X$ is
$$ f(x) = 0.5,\quad -1 < x < 1 $$
The random variable Y is defined as
$$ Y = \begin{cases} -2X, & -1 < X < 0 \\ X+1, & 0 < X <1 \end{cases}$$
I tried using the inverse transform method but I'm unsure of how to go about this since $Y$ takes values in $[1, 2)$ in both intervals provided above. I get the fact that there should be some sort of an overlapping in this case but can someone provide me with a rigorous way to solve this problem.
The answer was given to be
$$ f(y) = \begin{cases} 0.25, & 0 < y < 1 \\ 0.75, & 1 < y <2 \end{cases}$$
Here is what I did:
$P(Y \leq y) = P(-2X \leq y) = \frac{1}{2} + \frac{y}{4}$.
Taking the derivative of the above CDF, I get $f_Y(y) = 0.25$ when $0 < y < 2$.
I carried out the same procedure for the other interval and obtained $f_Y(y) = 0.5$ when $1 < y < 2$.
Is it alright to conclude that the pdf is as provided in the solution because there is an overlap between the two intervals? Is there a more rigorous way of showing this?