Let $X$ be a random variable and $f$ a non-decreasing function on the range of $X$. If $Y=f(X)$, then $$\{X\le q\}\subset\{Y\le f(q)\} \quad\quad\text{and}\quad\quad \{X<q\}\supset\{Y<f(q)\}$$ for any $q\in\mathbb R$.
How can one see these inclusions?
I've tried the following approach. We can write
$$\{X\le q\}=X^{-1}\left((-\infty,q]\right)\quad\quad\text{and}\quad\quad \{Y\le f(q)\}=X^{-1}(f^{-1}((-\infty,f(q)]))$$
Now if I could show that $(-\infty,q]\subset f^{-1}((-\infty,f(q)])$, then the first inclusion would follow, but I am struggling to see how.