Say that $f\in\mathcal{R}[a,b]$ and $f(x)≥0$ almost everywhere.
Say also that $\int^b_a f\geq 0$
I'm trying to prove that if $f$ and $g$ are integrable functions on $[a, b]$ such that $f(x) = g(x)$ almost everywhere, then $$\int^b_a f = \int^b_a g$$
If $f(x) = g(x)$ almost everywhere, then using the given information about $f(x)$, we can assume that $\int^b_a g\geq 0$ also on this interval.
It seems rather risky (in terms of mathematical reasoning) to say that "$a = b$ almost everywhere, hence the integral, derivative, etc. of $a$ equals that of $b$".
Is there a general theorem or rule I should be using to construct this proof?