Prove: If $f,g$ agree on $A\subseteq [a,b]$ then $\int_a^b f = \int_a^b g$.
In short, the proof starts with:
We'll choose partitions, $\Pi_n$ such that $\Pi_n \to \infty$. And they key in this proof is the claim that for every partition, $\Pi_n$, we can choose $t_0... t_m$ such that for every $\{t_i\} \subset A$ (and it is justified by the density of $A$).
From here, we just take the limit and we're done.
I don't understand completely why we can always choose $\{t_i\} \subset A$
I am assuming that $A$ is dense in $[a,b]$ and that $f,g$ are Riemann integrable as suggested by PhoemueX.
We define sequence of partitions $\Pi_n$ of $[a,b]$ in the following way:
For $n\in\mathbb{N}$ set $a_i^n = a+ \frac{i}{n}(b-a)$, $i=0,\ldots, n$. Then set $\Pi_n = \left\{ [a^n_{i-1},a^n_i] : i=1,\ldots, n\right\}$. Note that $a^n_i-a^n_{i-1}=\frac{b-a}{n}$ for all $i=1,\ldots, n$.
Now $A$ is dense in $[a,b]$ and therefore for any $n\in\mathbb{N}$ and $i=1,\ldots,n$ we have that $A\cap (a_{i-1}^n,a_i^n) \neq \emptyset$. Thus we may choose $t_i^n\in A\cap (a_{i-1}^n,a_i^n)$.
Since $f$ and $g$ are Riemann integrable we conclude $$ \int_a^b f = \lim_{n\to \infty} \sum_{i=1}^n \frac{f(t_i^n)}{n} (b-a) = \lim_{n\to \infty} \sum_{i=1}^n \frac{g(t_i^n)}{n} (b-a) = \int_a^b g.$$
Why is $A\cap (a_{i-1}^n,a_i^n) \neq \emptyset$? Well assume not, then $$A\subset [a,b]\backslash (a_{i-1}^n,a_i^n)$$ and since $(a_{i-1}^n,a_i^n)$ is open we have that $[a,b] \backslash (a_{i-1}^n,a_i^n)$ is closed thus the closure of $A$ is contained in $[a,b] \backslash (a_{i-1}^n,a_i^n)$ which contradicts the density of $A$ in $[a,b]$.