Given $f(x)$, a continuous function on the interval [0, 1] such that $f(x) ≥ 0$ for all $x ∈ [0, 1]$, show that if
$\int_0^1 f(x)dx = 0$ then $f(x) = 0$ for all $x ∈ [0, 1]$.
Is this true if $f(x)$ is Riemann Integrable on $[0, 1]$ but not assumed to be continuous on $[0, 1]$?
Assume that $f$ is not identically zero on $[0,1]$, and $\int_0^1 f(x)\,dx=0$. Then, there exists a point, say $x_0\in [0,1]$ with $f(x_0)>0$.
If $f$ is continuous, then there exists a neighborhood $N_{\delta}(x_0)$ of $x_0$ for which $f(x)>\frac12 f(x_0)$ for all $x\in N_{\delta}(x_0)$.
Therefore, we have
$$\begin{align} \int_0^1 f(x)\,dx &\ge\int_{x_0-\delta}^{x_0+\delta}f(x)\,dx\\\\ &\ge \delta f(x_0)\\\\ &>0 \end{align}$$
which provided the desired contradiction.
Therefore, $f\equiv 0$.
If $f$ is not continuous, then $f$ can contain any number of isolated points on $[0,1]$ for which $f>0$, and $\int_0^1 f(x)\,dx=0$.
In fact, the set of points for which $f>0$ can contain an infinite number of points, provided the measure of the set is zero, and we still have $\int_0^1 f(x)\,dx=0$. See this reference.