Question 2.1 of Bartle's Elements of Integration The problem 2.1 of Bartle's Elements of Integration says:

Give an exemple of a function $f$ on $X$ to $\mathbb{R}$ which is not
  $\boldsymbol{X}$-mensurable, but is such that the function $|f|$ and
  $f^2$ are $\boldsymbol{X}$-mensurable.

But, if one define $f^{+}:= \max\{f(x), 0\}$ e $f^{-}\max\{-f(x),0\}$, then $f = f^{+} - f^{-}$ and $|f| = f^{+}+f^{-}$. Also, $f$ is $\boldsymbol{X}$-mensurable iff $f^{+}$ and $f^{-}$ are mensurable. Therefore, $|f|$ is mensurable iff $f$ is mensurable. Is the problem wrong?
Edit:
Here $X$ is a set and $\boldsymbol{X}$ a $\sigma$-algebra over $X$.

Take any non-measurable set of $X$, say B. So $1_B$ will not be measurable but $1 = | 1_B | = 1_B^2$ are.
