Integral over X as supremum of integrals over finite subsets of X. I am trying to prove that
$$\int f d\mu = \sup \left\lbrace \int_E f d \mu, E \in S, \mu(E)< \infty \right\rbrace,$$
given that $\int f d\mu < \infty$. $f$ is a positive measurable function $f:X\rightarrow \mathbb{R}$. $S$ is $X$'s $\sigma$-algebra.
Attempt:
Since for all $E \in S$, it is true that $E \subset X$, then we get $f\chi_E\le f$, from which $$\int_E f \le \int f .$$
It follows that: $$\sup \left\lbrace \int_E f d \mu, E \in S, \mu(E)< \infty \right\rbrace \le \int f d\mu.$$
I want to show that:
$$\int f d\mu \le \sup \left\lbrace \int_E f d \mu, E \in S, \mu(E)< \infty \right\rbrace.$$
By exhibiting $E\in S$ satisfying: $\mu(E)<\infty,$ such that $\int f \le \int_E f$, as I would then have both inequatities, proving the equality.
I am having trouble trying to use the hypothesis: $\int f d\mu < \infty$. I tried constructing a sequence of functions $f_n$ whose limit-inferior was $f$ in order to apply Fatou's lemma, but I don't know if $\mu(X)<\infty,$ so this approach lead me nowhere.
Anyone got any ideas on how to proceed?
Thanks in advance.
 A: You can work directly from the definition.
Since $f$ is integrable, we have a sequence $s_n$ of simple measurable functions such that $0 \le s_n \le f$ and $\int s_n \to \int f$.
Each $s_n$ has the form $s_n = \sum \alpha_k 1_{A_k}$, where $\alpha_k > 0$ and the$A_k$ are measurable, $\mu A_k < \infty$ and, without loss of generality, disjoint. Let $E_n = \cup A_k$. Then $\mu E_n < \infty$. Then we have $s_n \le f \cdot1_{E_n}$, and hence $\int s_n \le \int f \cdot1_{E_n} = \int_{E_n} f \le \int f$. The result follows, since $\int s_n \to \int f$.
(Note: The fact that $\mu A_k < \infty$ follows from $\int s_n = \sum_k \alpha_k \mu A_k \le \int f < \infty$, and $\alpha_k >0$.)
Addendum: We have $\sup \{ \int_E f | \mu E < \infty \} \ge \int_{E_n} f$. Since $\int_{E_n} f \to \int f$, we have $\sup \{ \int_E f | \mu E < \infty \} \ge \int f$, as required.
A: Let $$E_n= \{x\in X\ | \frac1{n-1} \geq f(x)>\frac1{n} \}$$ with $\frac10=\infty$
Clearly $\mu (E_n)$ is finite or else $\int fd\mu=\infty$, and $$\int fd\mu=\int_{\cup E_n} fd\mu= \sum_n \int_{E_n} fd\mu < \infty$$ 
The series of positive real numbers converge, then the tail must go to zero. So, for any $\epsilon>0$, there exists an $M$ such that $$\int fd\mu< \sum_{n=1}^{M} \int_{E_n} fd\mu+\epsilon=\int_{\cup_{n=1}^ME_n}fd\mu+\epsilon$$
So $\sup \{ \int_E fd\mu\  |\ \mu (E) < \infty \} \ge \int fd\mu$, and the other inequality is trivial.
