If I have a random variable $$ X:[0,1] \rightarrow \mathbb{R} \quad \text{so that} \quad X(w)=\min\{w,1-w\} , \quad \text{ where } w \in [0,1]$$ The question is to find the inverse of the random variable ,which is as follows : $$ X^{-1}(]-\infty,x]=`\phi\quad \text{ if } x<0 $$ $$ [0,x]\bigcup[1-x,1] \quad\text {if} 0<=x<=1/2 $$ $$ [0,1] \quad\text {if} x>=1/2 $$ `
Does someone know how did he calculate it?