If a Riemann integrable function is zero on a dense set, then its integral is zero Let $g:[a,b]\to\mathbb{R}$ be a Riemann-integrable function such that $g(x)=0$ for all $x\in A\subseteq[a,b]$ where $A$ is dense set. Then 

$$\int_{a}^{b} g=0$$

How can I show this?
 A: As $g$ is Riemann integrable, we know that for all$\epsilon>0$ there exists $\delta>0$ such that for all $n$ and partitions $a=x_0<x_1<\ldots < x_n=b$ with $x_{i}<x_{i-1}+\delta$ for $1\le i\le n$, and for all choices of $\xi_i\in[x_{i-1},x_i]$, $1\le i\le n$, we have $$\left|\int_a^b g(x)\,\mathrm dx -\sum_{i=1}^ng(\xi_i)(x_i-x_{i-1})\right|<\epsilon $$
Per density of $A$, we can achieve that $g(\xi_i)=0$ for all $i$, hence
$$\left|\int_a^b g(x)\,\mathrm dx \right|<\epsilon $$
for all $\epsilon>0$, i.e., $$ \int_a^b g(x)\,\mathrm dx=0.$$ 
A: Here's a much simpler answer than the other two given: 
Note that for any partition $P$ of $[0,1]$, $L(f,P) \leq 0$ and $U(f,P) \geq 0$. Why is this? Because on any subinterval $S$ of your partition, the function must be $0$ somewhere on it (by density of $A$), and so $\inf_{S} f \leq 0$ and $\sup_{S} f \geq 0$. Using this, we can deduce that by integrability since $L(f,P$) and $U(f,P)$ must converge to a common value as you make your partition finer (i.e. the integral), this value must be zero. 
