# A nonmeasurable function such that $|f|$ is measurable, and the preimage of every point is measurable [duplicate]

Give an example of nonmeasurable function $f:(\mathbb{R}, Leb)\rightarrow \mathbb{R}$ such that $|f|$ is measurable and for every $a\in \mathbb{R}$ , $f^{-1}(\{a\})$ is a measurable set

My idea: suppose $E$ is a nonmeasurable subset of $[0,1]$ and $f:\mathbb{R}\rightarrow \mathbb{R}$ is such that $f(x)=x$ for $x\in E$ and $f(x)=x-e^x$ for $x\in E^{c}$.

• Do you have any thoughts? You're more likely to get good answers if you show you've tried the problem. What have you tried? Why did it not work? – Patrick Stevens Apr 10 '16 at 19:57
• My answer to this question incidentally satisfies "$\lvert g\rvert$ measurable" as well. – user228113 Apr 10 '16 at 19:59
• yes. suppose $E$ is a unmeasurable set and $f:R\rightarrow R$and $f(x)=x, x\in E$ and$f(x)=x-e^x , x\in E^{c}$ , E is a subset of [0,1] – user330305 Apr 10 '16 at 20:03
• @user330305 I don't see why the function you write should have measurable absolute value. – user228113 Apr 10 '16 at 20:10

Simplify your example by taking $f(x) =x$ for $x\in E$ and $f(x)=-x$ for $x\in E^c$.