Example of a non-measurable set of a particular kind Could someone give me an example of a Riemann integrable function $f : [a,b] \to \mathbb{R}$ for which there exists an open set $U \subset \mathbb{R}$ such that the set of points in $f^{-1}(U)$ where $f$ is continuous is not measurable (with respect to the Borel $\sigma$-algebra) ?
 A: If $f$ is Riemann measurable, then it is Lebesgue measurable as well, and thus such an example does not exists.
A: Edit. The first version of this answer was ridiculously wrong, due to bad lateX manipulations.
As pointed out by George, such a function does not exist.
The reason is that for any function $f$ on $[a,b]$, the set $Cont(f)$ of all continuity points of $f$ is a Borel set, more precisely a $G_\delta$ set, i.e. a countable intersection of open sets. To see this, define for each $n\in\mathbb N$
$$O_n:=\left\{ x;\; \exists W\;\hbox{open neighbourhood of}\; x\;:\; \vert f(u)-f(v)\vert<\frac1n\;\hbox{for all}\; u,v\in W\right\} $$
Then each $O_n$ is open in $[a,b]$ and $Cont(f)=\bigcap_{n\geq 1}O_n$. So $Cont(f)$ is $G_\delta$ in $[a,b]$.
Now, if $U$ is any open subset of $\mathbb R$, then $f^{-1}(U)\cap Cont(f)$ is open in $Cont(f)$ since $f$ is of course continuous when restricted to $Cont(f)$. Hence, $f^{-1}(U)\cap Cont(f)$ is a Borel set, for any function $f$.
Interestingly (?) enough, it is possible to find an example if you replace the set of continuity points by the set of discontinuity points $Disc(f)$.
Start with any uncountable closed set $C\subset [a,b]$ with Lebesgue measure $0$. Then, choose a non-Borel set $A\subset C$ (such a set exists because $C$ is uncountable), and and let $f:=\bf 1_A$ be the indicator function of $A$.
The set $Disc (f)$ is the boundary of $A$, i.e. the closure of $A$ in the present case because $A$ has empty interior (being contained in a Borel set of measure $0$). So $Disc(f)$ has measure $0$ since it is contained in $C$, and hence $f$ is Riemann-integrable.
On the other hand, if you take $U:=(1/2,2)$, then $f^{-1}(U)\cap Disc(f)=A\cap Disc(f)=A$ since $Disc(f)=\overline A$. Hence, $f^{-1}(U)\cap Disc(f)$ is not Borel-measurable.
