About functions on non-measurable sets Let $E$ be a Lebesgue measurable subset of $\mathbb{R}$. We say that a function $f:E\longrightarrow \mathbb{R}$ is Lebesgue measurable if, for every $\alpha\in \mathbb{R}$, the set $\{x\in E: f(x)>\alpha\}$ is Lebesgue measurable (equivalently, "$>$" can be replaced by "$\geq$", "$<$", or, "$\leq$").
Now we consider a subset $E$ of $\mathbb{R}$, which is NOT Lebesgue measurable. The following questions seem to be interesting:
(1) Is it possible to define/have a function $f:E\longrightarrow \mathbb{R}$ such that, for every $\alpha\in \mathbb{R}$, the set $\{x\in E: f(x)>\alpha\}$ is Lebesgue measurable ?
(2) Is it possible to define/have a continuous function $f:E\longrightarrow \mathbb{R}$ such that, for every $\alpha\in \mathbb{R}$, the set $\{x\in E: f(x)>\alpha\}$ is Lebesgue measurable ?
Does anybody have answers/counterexamples concerning these (possible) pathologies? Or, these questions make sense ?
 A: No, (1) (and hence (2) as well) cannot happen. Remember that the measurable sets form a $\sigma$-algebra: in particular, the union of countably many measurable sets is measurable.
Suppose $E,f$ are as in (1). We have $$E=\bigcup_{\alpha\in\mathbb{R}}\{x\in E: f(x)>\alpha\}.$$ But every real number is bigger than some rational, so this is the same as $$\bigcup_{\alpha\in\mathbb{Q}}\{x\in E: f(x)>\alpha\}.$$ By assumption, this latter set is a countable union of measurable sets (since $\mathbb{Q}$ is countable), so $E$ was measurable to begin with.


*

*We could also have used $\mathbb{Z}$ in place of $\mathbb{Q}$, and it's certainly easier to see that $\mathbb{Z}$ is countable; but using $\mathbb{Q}$ as an "$\mathbb{R}$-substitute" is so useful that I want to do it here too even if it's a bit silly. The specific property that makes $\mathbb{Q}$ really useful is that it's dense in $\mathbb{R}$; obviously $\mathbb{Z}$ isn't. Of course that's unnecessary here, but it gets used extensively down the road.



Incidentally, I've phrased this as a proof by contradiction, but that's really unnecessary: what we're actually doing is showing that for any $E,f$, if $\{x\in E: f(x)>\alpha\}$ is measurable for each $\alpha\in\mathbb{R}$ then $E$ is a union of countably many measurable sets and hence measurable. This is a completely direct proof.
