Non measurable function verification Let $E$ be nonmeasurable subset of [0,1] and define $f:[0,1]$ as:
$$f(x)=\begin{cases}-\frac1{2},\ \ x\in E\\0,\ \ \text{otherwise}\end{cases}$$
Then, I feel that  both $f,|f|$ are clearly nonmeasurable, because preimage of the singleton sets $\{0\}\ \ ,\{\frac1{2}\}, \ \ \{\frac1{2}\}$ are non measurable. Am I right? I have two books which say that both $f,|f|$ are measurable in the answers section. I am confused. Any hints. Thanks beforehand. 
 A: We will prove the following useful and more general result, which provides an answer to your question:

Let $(X,\mathcal{A},\mu)$ be a measure space and $E\subseteq X$. Then:
  $$E\text{ is measurable }\Leftrightarrow \chi_E\text{ is measurable}$$
  where, with $\chi_E$ we note the characteristic function of $E$.

(In all the following, $\mathbb{R}$ is considered to be equiped with the usual Lebesgue measure).
Proof:
($\Rightarrow$) Let $E$ be a measurable subset of $X$. Let also $a\in\mathbb{R}$ and let $A=\chi_E^{-1}((-\infty,a])$. Consider the following cases:


*

*If $a\geq1$, then $A=X$, which is measurable.

*If $0,\leq a<1$, then $A=X\setminus E$, which is measurable as the complementary set of $E$.

*If $a<0$, then $A=\varnothing$, which is measurable.


So, in any case, $A$ is a measurable set, and, since $a$ was arbitrary, $\chi_E$ is measurable.
($\Leftarrow$) Let $\chi_E$ be measurable. Then, since $\{1\}$ is (Lebesgue) measurable, it is evident that $E=\chi_E^{-1}(\{1\})$ is measurable.
Notes:


*

*It is clear that this proposition has a a straightforward implication that:


$$E\text{ is not measurable }\Leftrightarrow\chi_E\text{ is not measurable}$$


*It is also clear that the same applies for multiples of characteristic functions.


Taking into consideration all the above, your claim is right.
