Showing a function is discontinuous using open sets

continuitygeneral-topology

I am experimenting with the following theorem:

A function $f:A\rightarrow B$ is continuous iff $f^{-1}(O)$
is open in A for every open set $O\subset B$.

I am trying to find an open set in the range of the following function to show that it is discontinuous. What is such a set?
$$f:[-1, 1]\rightarrow\mathbb{R}$$
$$
f(x) = \begin{cases}
x & x<0 \\
x-1 & x\geqslant0
\end{cases}
$$

I tried using intervals such as: $(-0.5, 0)$ and $(0, 0.5)$ but they led me nowhere.

Best Answer

Take $O=\left(-\frac32,-\frac12\right)$. Compute $f^{-1}(O)$ and you will see that it is not an open subset of $[-1,1]$.