if $\int\limits_a^bf(x)dx=0$ for all rational numbers $aLet $f:\mathbb{R}\to\mathbb{R}$ be an integrable function.
Show that if $\int\limits_a^bf(x)dx=0$ for all rational numbers $a<b$, then $f(x)=0$ all most everywhere.
Hint:  First prove $\int\limits_Af=0$ for $A$ an open set, then for $A$ measurable.
My attempt:
Let $A$ an open set in $\mathbb{R}$. Then  we can write $A=\bigcup\limits_{k}(a_k,b_k)$ where $\left\{(a_k,b_k)\right\}_{k=1}^{\infty}$ is a disjoint collection of open intervals with rational end points(Is this possible?)
So $\int\limits_Afdx=\int\limits_{\bigcup\limits_{k}(a_k,b_k)}fdx=\sum\limits_{k=1}^{\infty}\int\limits_{a_k}^{b_k}fdx=0$
Then how should I use the result to for measurable $A$ and moreover, after doing so, does $\int\limits_{\mathbb{R}}f=0$ implies $f=0$  a.e?
Appreciate your help
 A: I think it is simple.
Let $A=\{x:f(x)\not=0\}$
$B=\{x:f(x)=0\}$
$\mu (D)$ is measure of set $D$.
We know $\mu (A)=0$ and $\mu (B)=b-a$.
Lebesgue integral:
$\int_{a}^{b}f(x)dx=\int_{A} f(x)d\mu+\int_{B} f(x)d\mu=0$
Because
$\int_{A} f(x)d\mu=0$( because $f(x)=0$ almost everywhere)
and $\int_{B} f(x)d\mu=0$
A: You can do a classic trick of defining the collection
$$ \mathcal{E}:=\{ A\in \mathcal{B}_\mathbb{R}: \int_A fdx=0 \}, $$
and then show that $\mathcal{E}=\mathcal{B}_\mathbb{R}$. Since $f$ is measurable the final desired result will follow because otherwise $\pm \int_{B_\pm} fdx>0$ where $B_\pm=\{x\in\mathbb{R}: \pm f(x)>0\}$.
You can later verify that $\mathcal{E}$ is a $\sigma$-algebra, so if you show that $A\in \mathcal{E}$ for any open set $A$, then it will follow that $\mathcal{E}=\mathcal{B}_\mathbb{R}$.
Finally since the intervals with rational endpoints is a countable basis of the topology on $\mathbb{R}$, for any open $A\subseteq \mathbb{R}$ there exists a collection of  intervals with rational endpoints, $\{ (a_k,b_k) \}_{k=1}^\infty$ such that $A=\cup (a_k,b_k)$. Using the DCT, you get that $\int_A f =0$.
