What's special about measurable functions? 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?
 A: When you calculate a Riemann integral, you usually take an infinitesimal step along the "$x$"-axis and approximate the function $f$ on this interval as a constant or as a line (rectangular or trapezoidal approximation).
In Lebesgue integration, you do a different thing. You take infinitesimal steps along the "$y$"-axis and ask: For which $x$ is the function $f$ equal to $y$? This gives you a set $S(y)$, the preimage of $y$ under $f$; to be more precise,
$$ S(y) = f^{-1}(y)= \{x{:}\ y\le f(x)\le y+dy\}.$$
Integration now means that you multiply the "size" of this set (its measure) by $f(x)$, and sum the results for all $y$. But the set $S(y)$ can only be measured if the function $f$ is measurable. That's where this term comes in. In other words, if there is an $y$ for which the set $S(y)$ is not measurable, there is a term missing in the computation of the integral.
A: I have two perspectives to suggest.
Given a function $g$, let 
$$I_+(g) = \inf \left \{ \int f d \mu : f \text{ is simple },f \geq g \right \} \\
I_-(g) = \sup \left \{ \int f d \mu : f \text{ is simple },f \leq g \right \}.$$
Then $g$ is bounded and measurable if and only if $I_+(g)=I_-(g)$. This parallels the Riemann situation (replacing piecewise constant functions by simple functions). You can extend to the unbounded case after you have already developed the bounded case.
Alternately, for nonnegative $g$, define $\int g d \mu$ to be $\lim_{n \to \infty} \int s_n d \mu$, where $s_n$ is an increasing sequence of simple functions which converges a.e. to $g$. Then such a sequence exists if and only if $g$ is measurable, and the value obtained is independent of the sequence of simple functions chosen.
The first perspective is closer to how you've formulated your question, but I think the theory is easier to develop from the second perspective.
