Let $f : E \rightarrow \mathbb{R}$. Show that if $|f|$ is measurable on $E$ and the set $\{f > 0\}$ is measurable, then $f$ is measurable on $E$. I'm learning about Measure Theory (specifically measurable functions) and need help with the following problem:

Let $f : E \rightarrow \mathbb{R}$. Show that if $|f|$ is measurable on $E$ and the set $\{f > 0\}$ is measurable, then $f$ is measurable on $E$.


What I don't understand is that the implication $$|f| \ \text{measurable}  \implies f \ \text{measurable} \ \ (1)$$ is clearly false. 
For example, let $A$ be a non-measurable subset of $\mathbb{R}$, and let $f$ be the function $$f(x) = \begin{cases} 1\text{ if }x\in A,\\ -1\text{ if }x\notin A.\end{cases}$$
Then $f$ is not measurable ($f^{-1}[\{1\}] = A$) but $|f|$ is measurable (it's the constant function $1$). 

How does the additional condition that $\{f > 0\}$ is measurable makes the implication $(1)$ true and how do I prove it? 
 A: Ok, I make my comment an answer. I assume that you know that product and sum of two measurable functions is again measurable. Define $f_+ := \max\{f,0\} = |f|\cdot\chi_{\{f>0\}}$. This function is measurable. Also, define $f_- := \min\{f,0\} = (-|f|)\cdot\chi_{\{f\le 0\}}$. Also this function is measurable. So, $f = f_+ + f_-$ is measurable.
EDIT: To see that $\chi_A$ is measurable for each measurable set $A$, you only have to realize that $\chi_A^{-1}(B)$ can only be equal to $\emptyset$, the whole measurable space $E$, $A$ or $E\setminus A$ (depending on whether $0\in B$ or $1\in B$).
A: You have that
if $b \geq 0, f^{-1}(]b,a[) = (|f|)^{-1}(]b,a[) \cap \{f > 0 \}$, so it's measurable
if $b < 0, f^{-1}(]b,0]) = (|f|)^{-1}([0,-b[ ) \cap \{f > 0 \}^c$, so it's also measurable
This imply that if $a>0, b<0$,  $f^{-1}(]b,a[) = f^{-1}(]0,a[) \cup f^{-1}(]b,0])$ is measurable
if $a < 0, b<a, f^{-1}(]b,a[) = (|f|)^{-1}(]-a,-b[) \cap \{f > 0 \}^c$, so it's also measurable
hence $f^{-1}(]b,a[)$ is measurable for all $a>b$
