If $f:[0,1]\rightarrow\mathbb{R}$ is a function such that $f=0$ over a dense set in $[0,1]$ so $\int_0^1 f=0$? 
If $f:[0,1]\to \mathbb{R}$ is a Riemann-Integrable 
  function such that $f(x)=0$ over a dense set in $[0,1]$ so $$\int_0^1 f(x) dx=0$$

I'm thinking about it but without progress. Would someone explain this to me using Riemann sums. 
I'm not able to argue that this Riemann integral is zero.
 A: Since $f$ takes the value $0$ in every interval within $[0, 1]$, we must have $m_i \le 0$ and $M_i \ge 0$ for all $i$ for every partition $P = \{0 = x_0 < \cdots < x_n = 1\}$. It follows that $L(P, f) \le 0$ and $U(P, f) \ge 0$ for all $P$. Hence $\sup_P L(P, f) \le 0$ and $\inf_P U(P, f) \ge 0$.
Since $f$ is Riemann integrable, $\sup_P L(P, f)$ and $\inf_P U(P, f)$ are equal. This forces both values to be zero. Therefore the integral itself is zero.
A: Another approach:
We know (or prove it: it's very easy) that
$$S\subset [0,1]\;\;\text{is dense there}\;\;\iff S\cap A\neq \emptyset\;\;\forall\;\text{open non-empty}\;\;A\subset [0,1]$$
Thus, if $\;f(s)=0\;\;\forall\,s\in S\;$ , then for any subinterval $\;I_k:=[x_k,x_{k+1}]\;$ of any partition of $\;[0,1]\;$ we can find an open $\;\emptyset\neq A_k\subset I_k\;$ and then we can choose $\;s_k\in S\cap A_k\;$ for the corresponding Riemann sum...
A: Counterexample:
$$f(x) = \begin{cases} 
0, & \text{if } x \in \mathbb{Q}, \\
1, & \text{if } x \in \mathbb{R} \ \mathbb{Q}.
\end{cases}$$
Therefore, $f$ is not integrable. Rational numbers are dense in $\mathbb{R}$.
