Why do we require a function to be measurable in order to define its Lebesgue Integral? Let be $f : X \to [0; + \infty)$ measurable.
We define the Lebesgue integral for $f$ as follow: $$ \int_X f(x) \ d\lambda(x) := sup \{ \ \int_X s(x) \ d\lambda(x) : s(x) \le f(x) \ \forall x \in X \ \} $$
where s(x) is a non-negative simple function.
I cannot understand why do we require $f$ to be measurable.
My thought is: we don't really need f to be measurable (I never mentioned it in the definition of the integral, I only said that $f(x)$ should be always not-smaller than any simple function $s(x)$). We never use it in the definition of the Lebesgue Integral. What we really need and indeed use is that the any simple function $s(x)$ be measurable (otherwise I cannot integrate it).
Now, my guess is: do we require $f(x)$ to be measureable in order to be sure that all its approximation (i.e. the simple function) are indeed measurable?
If I am wrong, where exactly in the definition of Lebesge Integral do we use the measurability of $f(x)$?
Thank you so much to you all, I really appreciate it.
 A: Without measurability, that definition could be called the lower Lebesgue integral $\underline{\int} f \,d\lambda$.  Unfortunately, it lacks desirable properties.  For example
$$
\underline{\int}(f+g)\;d\;\lambda = \underline{\int}f\;d\;\lambda + \underline{\int}g\;d\;\lambda
$$
may easily fail.
If $E$ is a Bernstein set in $[0,1]$, let $f = \mathbf1_E$ be its indicator function, and let $g = \mathbf1_{[0,1]\setminus E}$.  Then
$$
\underline{\int}(f+g)\;d\;\lambda = 1,\\
 \underline{\int}f\;d\;\lambda = 0,\\
 \underline{\int}g\;d\;\lambda = 0.
$$
A: There are several approaches to integration theory, all of them producing the same class of integrable functions. The most commonly taught in class nowadays are based on measure theory, starting by integrating measurable simple functions. Not surprisingly the extension of the integral to more general functions imply measurability of the integrands by way of approximation theorems.
There is one particular approach due to Daniell and later by Stone,  which does not make use of measure theory,  starts with a simple integral (think of Riemann integral), extends it, and   through an analysis of the properties of the integrable functions (Lusin and Littlewood principles), measurability is defined. This method I believe, shows why measurability is indeed inherent in integration.
Here is a brief explanation of how this construction works, avoiding technical details but trying to explain why we end up with having to deal only with measurable functions.

*

*Start with an elementary integral $I$ (for example the Riemann integral on $[a,b]$) on a space of bounded functions $\mathcal{E}$ (continuous functions on $[a,b]$ for example) which has a nice linear and order structure structure (a Stone lattice: $f,g\in\mathcal{E}$ then $cf+g, \max(f,g), \min(f,1)\in \mathcal{E}$). The integral $I$ on $\mathcal{E}$, is linear and positive, i.e. $I(f)\geq0$ if $f\geq0$, and has some countable continuity properties.

*Then a rather natural pseudo-norm $\|\;\|^*$ (the Daniell mean) can be define for any function on the space. The space of functions $\mathcal{F}$ for which that peusdo-norm is finite turns out to also be also a linear space. This is down by and up and down procedure: Let $\mathcal{E}^\uparrow$ the space of all numerical functions $h$ that are the countable suprema of a sequence $\phi_n\in\mathcal{E}$. For $h\in\mathcal{E}^\uparrow$
$$\int^*h=\sup\{I(\phi): \phi\in\mathcal{E}, \phi\leq h\}$$
for any function numerical function $f$
$$\int^*f=\inf\{\int^*h: h\in\mathcal{E}^\uparrow, f\leq h\}$$
Define $\|f\|^*=\int^*|f|$. It is easy to check that $I(\phi)=\int^*\phi$ for all $\phi\in\mathcal{E}$, and that $\|\;\|^*$ is homogeneous and has a triangle inequality.

*Then the space of integrable functions $L_1(\|\;\|^*)$ is defined as the closured of the set of elementary functions $\mathcal{E}$ on the big space $\mathcal{F}$ with respect the pseudonorm $\|\;\|^*$.

*The elementary integral $I$ is then expanded to $L_1(\|\;\|^*))$ by means of Cauchy sequences. The expansion $I$ is still linear an an positive.

*A consequence of the construction is that all integrable functions are in essence uniform limits of sequences of elementary functions $\mathcal{E}$ on large sets.

*Measurability is defined in terms of the property described in (5), that is, a function $f$ is $\|\;\|^*$-measurable iff on large sets, $f$ is the uniform limit of a sequence of an elementary functions.

*Further analysis shows that functions $f$ are integrable precisely when they are measurable and have finite $\|\;\|^*$-mean.

A nice treatment of this is in Bichteler, K., Integration theory: A functional approach, Birkhäuser. The book of Riesz, F. and Nagy, S. B, Functional Analysis, Dover, also starts with a functional approach. Several books now: Bogachev, V.I., Measure Theory, Vols I, II, Springer, Cohn, D., Measure Theory, Birkhäuser, among others) also dedicate a chapter to the ways of Daniell and Stone.
There is another theory of integration (at least for the real line and Euclidean space)  that has the objective of having good fundamental theorems of Calculus. These are the Gauge integrals of Denjoy-Perron, and Henstock-Kurzweil (HK). The later starts with a slight  change in the definition of Riemann sums, and yields a very rich set of integrable functions that includes Lebesgue integrable functions. Measurability creeps in again in the Fundamental theorem of Calculus, that is, a function that is integrable in the HK sense is necessarily measurable.
Daniell's approach to integration and the more general HK approach, which in principle have nothing to do with measurability, show that measurability is a natural property for integrable functions.
A: 
Let be $f : X \to [0; + \infty)$ measureable.
We define the Lebesgue integral for $f$ as follow: $$ \int_X f(x) \ d\lambda(x) := sup \{ \ \int_X s(x) \ d\lambda(x) : s(x) \le f(x) \ \forall x \in X \ \} $$
where s(x) is a non-negative simple function.

Let $s$ be a simple function. By definition $s(x)=\sum\limits_{i=1}^{n}\alpha_{i}1_{A_{i}}(x)$ with $A_{i}$ being disjoint and measurable sets.
The integral for such a simple function is defined as $\int_X s(x) \ d\lambda(x)=\sum\limits_{i=1}^{n}\alpha_{i}\lambda(A_{i})$.
Furthermore one can prove that every measurable function can be approximated by as series of simple functions. Therefore the requirement of measurability on $f$ in the definition.
A: The Lebesgue integral uses the Lebesgue sums, rather than the Riemann sum. Say the function $f$  takes values in $[0,1]$ for simplicity. Then take a division of $[0,1]$
$y_0 < y_2 < \ldots < y_n=1$  with a system of intermediate points $c_i \in [y_i, y_{i+1})$,  and consider the Lebesgue sum
$$c_0 \cdot \mu(f^{-1}[y_0, y_1)) + \cdots + c_{n-2}\cdot  \mu(f^{-1}( [y_{n-2}, y_{n-1})) + c_{n-1}\cdot \mu(f^{-1}( [y_{n-1}, y_{n}])$$
You can allow other partitions of the co-domain, but these will be enough. Note that we need we are interested in the measure of the sets $f^{-1}([y_i, y_{i+1})$ or  $f^{-1}([y_i, y_{i+1}]$ so they would better be measurable.
Now, the thing is that these sum converge to something, when the norm of the partition $\to 0$. It almost looks like magic. The only thing needed is a way to assign a size (number) to certain subsets of the domain.
