Example that the Lebesgue integral of a function can take any value between $[0,c]$ Latest homework question in measure and integration theory course. Suppose that $f_n : \mathbb{R} \to \mathbb{R}$ are integrable, $f_n ≥0$ and $f_n(x) \to f(x)$ for every $x $. Suppose that
$$\int f_n\to c≥0 .$$ Show that $\int f$ exists
and  $0≤ \int f ≤ c$. Show by examples that every value in $[0 ，c]$ is possible.
I can show $\int f$ exist by showing $\int|f|$ being finite and use Fatou's lemma to show $\int f ≤ \liminf \int f_n = c$. 
But I can't do the part that $\int f ≥ 0 $. I am also confused since $\int f =\int\lim f_n $， how could I find an example that the Lebesgue integral is not fixed.
 A: By pointwise comparison you have that $0 \leq \liminf f_n(x) = \lim f_n(x) = f(x)$ so that $\int f \geq 0$. 
To show that every value in $[0,c]$ is possible, we need to construct a different $f$ (and hence a different $(f_n)$) for each $\lambda\in[0,c]$. We do so as follows: 
Let 
$$ g_n(x) = \begin{cases} n & x\in (0,1/n] \\ 0 &\text{otherwise} \end{cases} $$
and let
$$ h(x) = \begin{cases} 1 & x\in [-1,0) \\ 0 &\text{otherwise}\end{cases} $$
Observe that $\int g_n \mathrm{d}x = 1 = \int h\mathrm{d}x$. 
Let $$f_{n,\lambda} = (c-\lambda) g_n(x) + \lambda h(x)$$
clearly 
$$ \int f_{n,\lambda} = c $$
so 
$$ \liminf_{n\to\infty} f_{n,\lambda} = c$$
But pointwise you have that
$$ f_\lambda(x) := \lim_{n\to\infty} f_{n,\lambda}(x) = \lambda h(x) $$
using that the pointwise limit
$$ \lim g_n(x) = 0 $$
for any $x$. This implies that
$$ \int f_\lambda(x) \mathrm{d}x = \lambda \in [0,c] $$
as desired. 
A: If $\int f < 0$, then $f < 0$ on a set of positive measure (but really, you only need to know that for some $x_0$, $f(x_0) < 0$). Since $f_n(x)\rightarrow f(x)$ for each $x$, for some $x_0$ you must have $f_n(x_0) < 0$ for some $n$, contradicting the hypothesis. Now, just because $\int f = \int \lim_n f_n$ does not mean that $\int f = \lim_n \int f_n$. For example, take $f = 0$,let $f_n = 0$ on the negative real half-line, and for $x\geq 0$, define $f_n$ as follows:
$f_n(x) = 0$ if $x > 1/n$, and $f_n(x) = n$ for all $x\in [0, 1/n]$. Obviously $\int f_n = 1$ for all $n$, $f_n \rightarrow f$ and $\int f = 0$. 
A: Well notice that $f\geq 0$ because $f_n\geq 0$ the by Fatou's Lemma we get
$\int f \leq \liminf \int f_n =c< \infty$. 
For the example, for each $0\leq \lambda \leq c$ consider the sequence of functions
$$g_n(x)=\chi_{[n,n+c-\lambda]}(x)+\chi_{[0,\lambda]}(x).$$
