Is it true that for any Borel measurable function from $\mathbb{R}$ to $\mathbb{R}$, we can find a set $B \subset \mathbb{R}$, s.t. $m^*(\mathbb{R} - B) = 0$ (Lebesgue outer measure), and $f_{|B} : B \rightarrow \mathbb{R}$ is a continuous function? If not, what is a counterexample?
For example, for $f = \mathbf{I}(x \in {\mathbb{Q}})$ (indicator function), we can choose $B = \mathbb{R} - \mathbb{Q}$, so that $f_{|B}$ is a constant function (taking value 0), and therefore continuous.
Counterexample: let $f$ be the indicator function of a "fat Cantor set" $A$, i.e. a nowhere-dense compact set of positive measure. If $\left. f\right|_B$ is continuous and $a \in A \cap B$, there is $\delta > 0$ such that $B \cap (a-\delta, a+\delta) \subset A$. But $(a-\delta, a+\delta)$ contains an interval of $A^c$, and this interval has positive measure and is disjoint from $B$, implying $m^*(B^c) > 0$. On the other hand, if $B \subseteq A^c$, again $m^*(B^c) > 0$.