Show that if $(X, \mathcal{M})$ is a measurable space then $f:X \rightarrow[-\infty,\infty]$ is measurable iff $f^{-1}((b,\infty])\in \mathcal{M}$ for all $b \in \mathbb{R}$.
Clearly $(\implies)$ holds since $(b,\infty]$ is a borel set and measurability implies the preimage of a measurable set is measurable.
$(\Longleftarrow)$ Suppose $f^{-1}((b,\infty]) \in \mathcal{M}$. Since any open set in the extended Euclidean topology can be written as a countable union of sets from $\{(a,b) \mid a,b \in \mathbb{R}\}\cup \{[-\infty,b) \mid b \in \mathbb{R}\}\cup \{(a,\infty] \mid a \in \mathbb{R}\}$ we can write $B$ borel as $\bigcup\limits_{i=1}^{\infty}((a_i,b_i) \cup [-\infty,c_i) \cup (d_i, \infty])=\bigcup\limits_{i=1}^{\infty}(((a_i,\infty] \setminus \bigcap\limits_{n=1}^{\infty}(b_i-\frac{1}{n},\infty]) \cup (X-((c_i,\infty]) \cup (d_i, \infty])$
Thus, the preimage of this union is in $\mathcal{M}$ so that measurability of any borel set holds