Confusion in showing that $f$ is measurable Question:

Show that
\begin{align}
f(x) = 
\begin{cases}
-3x, &x < 0,\\
x, &0 \leq x \leq 2\\
1 - x, &x > 2
\end{cases}
\end{align}
mapping $(\mathbb R, \mathcal B_{\mathbb R}, \mu_{\mathcal L})$ to its range equipped with the Borel $\sigma$-algebra is measurable.

My attempt:
I know that I need to check that the preimages of measurable sets under $f$ are measurable, and that this condition only needs to be checked for a set of subsets that generates the Borel $\sigma$-algebra on the range side.
My problem is that the question says that $f$ maps "to its range", or in other words, $f \colon \mathbb R \to (-\infty, -1) \cup [0, \infty)$ which means that I start thinking about the subspace topology on the range, and the Borel $\sigma$-algebra on the range, finding some set that generates the Borel $\sigma$-algebra on the range. I just get really bogged down because (as far as I know) I can't just check that for example $f^{-1}(-\infty, b)$ is measurable for any $b \in \mathbb R$.
I have done some work in this direction but I'm not including it because it gets messy and given the level of the class I'm not sure we've even expected to know much topology. Am I overthinking this? Can I just check that $f^{-1}(-\infty, b)$ is measurable for any $b \in \mathbb R$ measurable?
I appreciate any help.
 A: This is one place where a little bit of category theory goes a long way.
If $A \subseteq X$ and we have a $\sigma$-algebra $\mathcal{M}$ on $X$, then obviously we can restrict it to a $\sigma$-algebra $\mathcal{M} \! \upharpoonright_A$ on $A$. This subspace algebra behaves entirely analogously to the subspace topology, and they have a similar universal property:

$f : (Z, \mathcal{F}) \to (A, \mathcal{M} \! \upharpoonright_A)$ is measurable if and only if $\iota \circ f : (Z, \mathcal{F}) \to (X, \mathcal{M})$ is measurable, where $\iota : A \hookrightarrow X$ is the inclusion map.

This is why people in the comments are telling you it's ok to ignore the question of the domain, since this universal property tells you that $f$ is measurable as a function from $\mathbb{R} \to (-\infty,-1) \cup [0,\infty)$ if and only if $f$ is measurable as a function from $\mathbb{R} \to \mathbb{R}$. Incidentally, measure algebras and topologies have a lot of similar categorical properties. You can read more about this in a blog post of mine.

That said, if category theory isn't your bag, we can also show this directly. We know that the borel algebra on $A = (\infty, -1) \cup [0,\infty)$ is generated by the opens on that space. But we also know that if $A \subseteq \mathbb{R}$, the topology on $A$ is generated by open sets of the form $(a,b) \cap A$ for $a,b \in \mathbb{Q}$ (or $\mathbb{R}$, if you prefer).
So then, it suffices to check that $f^{-1} \big ( (a,b) \cap A \big )$ is measurable for each $a,b \in \mathbb{Q}$, and but since the image of $f$ is contained in $A$, this preimage is the same as $f^{-1} \big ( (a,b) \big )$.
Either way, I think you're stressing more than is necessary!

I hope this helps ^_^
