Let $X: \mathbb R \to \mathbb R$, where $\forall \omega \in \mathbb R -\mathbb Q: X(\omega)=0$. Show $X$ is $\mathcal{B}(\mathbb R)-\mathcal{B}(\mathbb R)-$measurable function:
My ideas: Using the definition of measurability I could take any $C \in \mathcal{B}(\mathbb R)$ and I then want to show $X^{-1}(C) \in \mathcal{B}(\mathbb R)$, but from the definition of the $X$ , all I can take away is that $\mathbb R - \mathbb Q \subseteq X^{-1}(\{0\})$ but this in no way shows measurability.
Another approach could be to take a generator $\mathcal{E}$, and prove $X^{-1}(\mathcal{E}) \subseteq \mathcal{B}(\mathbb R)$. I think the biggest problem is that I have no definition of $X(\omega)$ where $\omega \in \mathbb Q$.
Any tips?
Hint using your first approach: