# Prove that $\int_a^b f\,dx= 0$ given $f(r)= 0$ for all $r \in \mathbb{Q}\cap[a,b]$

Suppose that $f$ is a nonnegative Riemann integrable function on $[a,b]$ satisfying $f(r) = 0$ for all $r\in\mathbb{Q}\cap [a,b]$. Prove that $\int_a^b f\,dx = 0$.

Since all rational function values give $f = 0$, does $f(x) = 0$? If yes, how can I show that formally?

If no, how would I approach this proof?

-
For the first question, this would happen if $f$ is continuous. Else, consdier ${\bf 1}_{\Bbb R\setminus \Bbb Q}$, the indicator function of the irrationals. –  Pedro Tamaroff Dec 13 '12 at 2:12
You cannot conclude that $f(x)= 0$ for all $x$. However, note that if $f(x_0)>0$ for some $x_0\in [a,b]$, then $x_0$ must be a point of discontinuity of $f$ (why?). What do you know about the set of points where a Riemann integrable function is discontinuous? –  froggie Dec 13 '12 at 2:15
Hint: If $f$ is Riemann integrable, then the value of the integral can be approximated as closely as you wish by any Riemann Sum corresponding to a partition of $[a,b]$ with sufficiently small norm. –  David Mitra Dec 13 '12 at 2:37
Let $f$ be Riemann Integrable on $[a,b]$ with $I=\int_a^bf(x)\,dx$. Then for every $\epsilon>0$, there exists a $\delta>0$ so that if $\{x_0,\ldots, x_n\}$ is a partition of $[a,b]$ with $\max\limits_{1\le j\le n}(x_j-x_{j-1}) <\delta$, then $$\Bigl| I-\sum_{j=1}^n f(t_j)(x_j-x_{j-1})\Bigr|< \epsilon$$ for any choice of $t_1,\ldots t_n$ with $t_j\in [x_{j-1},x_j]$ for each admissible $j$.
Now note that given any partition of $[a,b]$, you can choose tags $t_i$ so that the corresponding Riemann sum for your function has the value $0$.
I'll point out here that the hypothesis that $f$ be nonnegative is not necessary. –  David Mitra Dec 13 '12 at 3:25