From the divergence theorem for any vector field E,
$\displaystyle\oint E\cdot da=\int (\nabla\cdot E) ~d\tau$
and from Gauss's law
$\displaystyle\oint E\cdot da=\frac{Q_{enclosed}}{\epsilon_0}=\int \frac{\rho}{\epsilon_0}~d\tau$
Hence,
$\displaystyle\int\frac{\rho}{\epsilon_0}d\tau=\int (\nabla\cdot E)~d\tau$
Textbooks conclude from the last equation that
$\displaystyle \nabla\cdot E=\frac{\rho}{\epsilon_0}$
My question is how can we conclude that the integrands are the same? Because I can think of the following counter example, assume
$\displaystyle \int_{-a}^a f(x)~dx=\displaystyle \int_{-a}^a [f(x)+g(x)]~dx$
where $g(x)$ is an odd function. Obviously the 2 integrals are equal but we cannot conclude that $f(x)$ is equal to $f(x)+g(x)$ so where is the flaw?