# Show that a function $f(x)$ is $\mathcal{B}/\mathcal{B}$-measureable.

So, I have to show that the function $f\colon \mathbb{R} \to \mathbb{R}$ given by:

$f(x) = \begin{cases} -x & \text{if$x < 0$,} \\ 2 & \text{if$x \geq 0$,} \end{cases}$

is $\mathcal{B}/\mathcal{B}$-measureable. And I'm not quite sure how to do it. Going by the definition, I'd have to show that

$f^{-1}(A) \in \mathcal{B}, \quad \forall A \in \mathcal{B}$.

$\{f \geq a\} = \begin{cases} \mathbb{R} & \text{if$a\leq 0$,} \\ (-\infty , -a] \cup [0,\infty) & \text{if$0<a\leq 2$,} \\ (-\infty , -a] & \text{if$a>2$,} \end{cases}$
and I'm thinking that I can use this to show measurability, but I'm not sure? Since all of the above are Borel sets, does it follow that $f^{-1}$ of any of the above are also Borel sets?
You can write $f$ as $$f(x) = 2\chi_{[0,\infty)}(x)-x\cdot\chi_{(-\infty,0)}(x)$$ (where $\chi$ denotes indicator function) which is measureable as sum/product of measurable functions.