Assignment:
Let $f$ be Lebesgue - measurable and $a,b \in \mathbb{R}$ with the property: $$\frac{1}{\lambda(M)} \cdot \int_Mf\ d\lambda \in [a,b]$$ for all Lebesgue - measurable sets $M \subset \mathbb{R}^n$ with $0 < \lambda(M) < \infty$.
Show that: $f(x) \in [a,b]$ almost everywhere.
So I need to show that the set $N$ defined as $N:= \{x\in\mathbb{R}^n; \ f(x) \notin [a,b]\}$ has a measure of zero. However, I cannot really see how to go from there and how the property given could help me.
I'd appreciate any help.
Suppose $N = \{x:f(x)\notin[a,b]\}$ is not a null set.
Then at least one of $N_1 = \{x:f(x)<a\}$ or $N_2 = \{x:f(x)>b\}$ is not a null set since $N = N_1\cup N_2$
If $N_1$ is not a null set, then (since $f(x)<a$ on $N_1$)
$$\frac{1}{\lambda(N_1)}\int_{N_1}f~d\lambda<\frac{1}{\lambda(N_1)}\int_{N_1}a~d\lambda=a$$
If $N_2$ is not a null set, then(since $f(x)>b$ on $N_2$)
$$\frac{1}{\lambda(N_2)}\int_{N_2}f~d\lambda>\frac{1}{\lambda(N_2)}\int_{N_2}b~d\lambda=b$$
Either way you contradict your assumption.