Let $f$ be Riemann integrable on $[0,1]$ s.t $0\leq f (x)\leq\int_0^1f(t)\hspace{.05cm}\mathrm{d}t$. Prove that $f(x)= 0$. 
Let $f$ be Riemann integrable on $[0,1]$ such that, for all $x\in[0,1]$:
$$0 \le f(x) \le \int_0^1 f(t)dt.$$
Prove or disprove that $f(x) = 0$ on $[0,1]$

This is a practice homework question that I was trying to solve to help me study for my upcoming analysis quiz.
So far all I can come up with is to make a partition of $[0,1]$ and that the upper and lower sums as well as the supremum and infimum of f are greater than or equal to zero.  I'm guessing I'll need to make a partition of $n$ equal sum intervals and find that $f(x_k)$ and $f(x_{k-1})$ are zero for all $k$.  But I am unsure how exactly to get to that point and how to use the fact that $f(x)$ is less than or equal to its integral.  Thanks for the help!
 A: Let us consider the case where $f$ is continuous. If $f(x)<\int_0^1f(t)\mathrm{d}t$ for some $x$, there will be $(x-\delta,x+\delta)$ where the inequality holds strictly. But then, letting $c:=\int_0^1f(t)\mathrm{d}t$:
\begin{align*}
c=\int_0^1c\mathrm{d}x={}&\int_0^{x-\delta}c\mathrm{d}x+\int_{x-\delta}^{x+\delta}c\mathrm{d}x+\int_{x+\delta}^1c\mathrm{d}x>{} \\
{}>{}&\int_0^{x-\delta}f(t)\mathrm{d}t+\int_{x-\delta}^{x+\delta}f(t)\mathrm{d}t+\int_{x+\delta}^1f(t)\mathrm{d}t=\int_0^1f(t)\mathrm{d}t=c,
\end{align*}
or, summing up:
$$c>c,$$
strictly, which is a contradiction. So we have proved that the inequality chain implies $f(x)\equiv c$. The converse also holds: if $f$ is constant, then it is constantly equal to its integral on $[0,1]$, so the inequality chain holds.
Of course, all this holds if we just assume $f(x)<\int_0^1f(t)\mathrm{d}t$ strictly at a point $x$ where $f$ is continuous. Which means that if the inequality chain is to hold, the points where $f$ is not its integral need to be of discontinuity, and with no $\delta$ as used in the above argument.
One case where the inequality holds and $f$ is not constant is where $f$ is constant except for a finite number of points where it is strictly less than its integral, that is, than the value it is almost constantly equal to.
If we trust this answer on the fifth condition, then Riemann-integrability implies there can be no interval contained in the set of discontinuities, so any point $x$ where the inequality holds strictly must be a discontinuity point and an isolated point. So in a way, the inequality chain plus Riemann integrability means $f$ is "almost everywhere" constant, "almost constant", that is, constant except in a set of isolated points of discontinuity.
In any case, your hypotheses do not imply $f$ is zero, but only almost constant.
A: *

*If $f(x)=1$, this relationship holds, so $f(x)=0$ is not the only solution.

*We can, however, prove that $f(x)=\int_0^1 f(t)\,dt$ a.e. Define $A=\{x\in[0,1]\:f(x)\ne\int_0^1 f(t)\,dt\}$, and suppose $\mu(A)\neq0$ Then:
$$\int_{[0,1]}f(t)dt=\int_{[0,1]-A}f(t)dt+\int_{A}f(t)dt$$
$$\implies\int_{[0,1]}f(t)dt-\int_{[0,1]-A}f(t)dt=\int_{A}f(t)dt$$
But, the LHS is equal to $\mu(A)\int_0^1f(t)dt$, whereas the RHS is $< \mu(A)\int_0^1f(t)dt$ by the definition of $A$.
This forces a contradiction, whence we see that $\mu(A)=0$, i.e. $f(x)=\int_0^1f(t)dt$ almost everywhere.
