Although the comments more or less answer the question, and the question is a few years old, some readers might benefit from a complete answer.
Here is another way to think about the concept. "Almost everywhere" means some proposition/property is true everywhere except a set of measure zero. So if $f=g$ a.e. this means the following.
Let $f,g:X\rightarrow Y$ and let $E\subset X$ with $\mu(E)=0$. If $f=g$ on $X\setminus E$ and $f\neq g$ on $E$ then $f=g$ a.e.
Note that here, we did not assume the Lebesgue measure, or that we are even dealing with domains which are subsets of $\mathbb{R}^n$.
Here are some good examples of what can "go wrong" with functions equal almost everywhere. For simplicity, let's consider the Lebesgue measure on $\mathbb{R}$
$(1)$ Let $D(x)$ denote the Dirichlet function, where $D(x)=0$ if $x$ irrational and $D(x)=1$ if $x$ is rational. Now consider the zero function $f(x)=0$. Note that $f=D$ almost everywhere, since $\mu(\mathbb{Q})=0$ and $f\neq D$ only on $\mathbb{Q}$.
So even if two functions are equal almost everywhere, one can be continuous everywhere and the second one can be nowhere continuous.
$(2)$ Cantor's function is constant a.e. but monotone increasing.
$(3)$ Define $g(x)=0$ if $x$ irrational and $g(x)=x$ if $x$ is rational.
$g(x)$ is bounded a.e. but not globally bounded.
In addition, you can show two functions in $L^2$ are equal almost everywhere if you can show their Fourier series and/or Fourier transforms are equal almost everywhere.
There are countless of other such examples.
If $\mu$ is a complex measure, then there exists a measurable function $h$ with $|h(x)| = 1$ for all $x \in X$ such that
$$ d \mu = h \ d|\mu|.$$
Here, $|\mu |$ is the total variation measure associated to $\mu$. This statement follows from the Radon-Nikodym theorem. (See Rudin 6.12.)
Since $\int_E f d \mu = 0$ for all measurable $E$, it follows that
$$ \int_E f(x) h(x) d |\mu| = 0$$
for all measurable $E$.
But the total variation measure $|\mu |$ is a positive measure! From the discussion in the comments, we know that your result applies to positive measures! So we deduce that
$$ f(x) h(x) = 0$$
almost everywhere with respect to $|\mu|$.
Finally, $|h(x)| = 1$ for all $x \in X$. Hence $f(x) = 0$ almost everywhere with respect to $|\mu |$. Since any set that is null with respect to $|\mu |$ also has zero measure with respect to $\mu$, your result follows.
Best Answer
If $f = g$ a.e. does not hold, then one of the sets
$$A_n := \{x \in X \mid f(x) \geq g(x) + 1/n\}$$
or
$$B_n := \{x \in X \mid g(x) \geq f(x) + 1/n\}$$
has positive measure (why?).
Now assume that $X$ is $\sigma$-finite (or semifinite, otherwise the statement is in general wrong).
Then there exists a subset $E \subset A_n$ or $E \subset B_n$ of positive, finite(!) measure (why?).
Conclude that $\int_E f \, d\mu \neq \int_E g \, d\mu$.
EDIT: As observed in the comments, it is not that easy to show that $\int_E f \,d\mu \neq \int_E g \, d\mu$ if one does not know that the two integrals are actually finite. But to ensure this, we can modify the sets $A_n,B_n$ to
$$ A_n ' = A_n \cap \{x \mid |f(x)|+|g(x)|\leq n\} $$ (similar for $B_n '$) and then use the proof as described above.