Let $(X, \mathcal{S},\mu)$ be a measure space, and let $f: X \to \mathbb{C}$ be a function. Then $f$ is integrable if Re$f$ and Im$f$ are integrable and $\int f := \int$Re$f+i\int$Im$f$.
It is easy to show that:
Re$f$ and Im$f$ are measurable and $|f|$ is integrable $\Rightarrow$ $f$ is integrable.
But why can't we omit the measurability of Re$f$ and Im$f$?