Maybe this question is rather trivial.
Suppose that there exists a Borel measurable function $f: {\mathbb{R}} \rightarrow \{0,1\}$. Does this imply that $f$ is measurable only for inputs of the form $(a,b)$ or a collection of inputs of this form? My main question is it enough to focus on inputs of the form of open ntervals without neglecting other sets for which $f$ is measurable?
By definition of $f$ being Borel measurable, $f^{-1}(\{0,1\})\in\mathcal{B}(\mathbb{R})$.
And the Borel set $\mathcal{B}(\mathbb{R})$ contains all the open sets of $\mathbb{R}$.