The function $f: \mathbb R \rightarrow \mathbb R$ is defined by $$\begin{equation} f(x)=\begin{cases} 2^n, & x=n \in \mathbb Z \\ 0, & \text{otherwise} \end{cases} \end{equation}$$
Is $f$ Borel measurable? Is $f$ Lebesgue measurable?
Please help on this. I want to understand why... Trying to self-teach this module.
The easiest way is to notice that $f$ differs from the zero function (which is measurable) on a null-set. As null-sets are always measurable, $f$ is measurable.
You can also do it explicitly: