Show that $\int_0^1f(x)dx=0$ The following question is based on multi-variable calculus and real analysis.

A set $A\subset [0,1]$ is dense in $[0,1]$ iff every open interval that intersects [0,1] contains a point of A. Suppose $f:[0,1]\to \mathbb{R}$ is integrable and $f(x)=0,\enspace \forall \enspace x \in A.$ Also assume that $f(x)\geq 0,\enspace \forall \enspace x \in [0,1].\enspace$Show that $\int_0^1f(x)dx=0$

I have no idea how to prove the above stuff rigorously. Then only thing I can think of  'if every open interval that intersects $[0,1]$ contains a point of A' is that set A contains all points of the interval $[0,1]$. Being that said it would be obvious for the integral to be zero.
This is all I could think of. I am pretty sure that my assumption would be incorrect.
 A: The following considers the function "Riemann integrable".
Take a Riemann approximation to the integral https://en.m.wikipedia.org/wiki/Riemann_sum , i.e. fix $x_0=0<x_1<...<x_n=1$,  and approximate:
$I \sim I_{\text{Riem}}=\sum_i f(x_i^*) (x_{i+1}-x_i)$
where $x_i^*$ belongs to $[x_i,x_{i+1}]$. According to the definition of Riemann integrable functions, $x_i^*$ can be taken any number in the interval and therefore it can be chosen to that $f(x_i^*)=0$ because $A$ is dense.
Therefore $I_{\text{Riem}}=0$. Since we can do this for a partition $P$ whose $\max_i (x_{i+1}-x_i) \rightarrow 0$, this implies that $I=0$. This argument does not use that $f \ge 0$.
If we consider "Lesbegue integrable" functions I think the statement is false since we can have dense sets of zero measure (e.g. the rational numbers). Therefore we can change the value of the function on this set without changing the value of the integral.
I hope not to have forgotten too much about integration theory on $\Bbb{R}$, please let me know if you see any error :)
A: So @Thomas has given a good proof.   But he lies when he says he has forgotten his integration theory.  He remembers it well!
He is also correct when he says the problem is (i) restricted to  Riemann integrable functions and false for the Lebesgue integral, and (ii) the hypothesis that $f(x)\geq 0$ is unnecessary.
In this situation there is always some jerk who butts in to give the advanced proof for a question that is clearly posed at the calculus level.
Can't resist!
From a later course in integration you will learn that

*

*If $f:[a,b]\to\mathbb R$ is Riemann integrable then it is continuous almost everywhere (i.e., except on a set of measure zero).


*If $f:[a,b]\to\mathbb R$ is Riemann integrable then it is also Lebesgue integrable and the values agree.


*If $f:[a,b]\to\mathbb R$ satisfies  $f(x)=0$  almost everywhere  then
$f$ is Lebesgue integrable and  $\int_a^b f(x)\,dx=0$.
With these there is an immediate solution to the problem.  Since $f$ is Riemann integrable it is continuous almost everywhere.  Since $f$ is zero on a dense set it must be zero at every point of continuity of $f$.  Hence
$f(x)=0$  almost everywhere,  $f$ is Lebesgue integrable and  $\int_a^b f(x)\,dx=0$ in the sense of the Lebesgue integral and also in the sense of the Riemann integral.


P.S.  Is the Lebesgue integral really that advanced?  Is it too terribly advanced for students to know  that Riemann integrable functions are continuous almost everywhere?
Lebesgue's original presentation of his integral required a good bit of measure theory as a prerequisite.  But that was 1901.  There are now much more elementary ways of introducing that material to early students of real analysis. It is entirely false when someone claims that the Lebesgue integral requires measure theory and needs one to abandon Riemann sums.  But, alas, most students have to wait many years before they can find a course in integration theory that brings them out of the 19th century.
