Non-mathematician here, trying to grasp theory of integration.
Why is it that the integral (or the $\mu$-integral) in, say, a measure theory book, is defined for measurable functions? The definition itself is first given for a simple function, which makes sense, and then we define the general integral of a positive integrand $g$ as $$ \sup\{ \int f \ d \mu : f \le g, f \ \text{is simple and positive}\}$$ and then further we define the integral of any $g$ in terms of $g^+$ and $g^-$ which are positive.
But $g$ is always required to be measurable...where does measurability come into play here? Why is that important? Where does the theory fall apart when $g$ is non-measurable?