There are measure spaces where all measurable sets have measure $0$ or $\infty$.
In such a space, let $f$ and $g$ be two different positive constants.
[EDIT] More generally, suppose there is a measurable set $M$ such that $\mu(M) = \infty$ and all measurable subsets of $M$ have measure either $0$ or $\infty$. Then you can take $f = \chi_M$ (the indicator function of $M$) and $g = 2 \chi_M$, and $$\int_A f \; d\mu = \int_A g \; d\mu
= \cases{ 0 & if $\mu(A \cap M) = 0$\cr \infty & otherwise}$$ for all measurable $A$.
Conversely, suppose there is no such $M$, $f$ and $g$ are nonnegative measurable functions, and it's not true that $f = g$ a.e. Then at least
one of the measurable sets $\{x: f(x) \le a < b \le g(x) \}$
and $\{x: f(x) \ge a > b \ge g(x)\}$ has measure $> 0$ for some $a,b\in [0,\infty)$. By assumption, some measurable subset $A$ of such a set has $0 < \mu(A) < \infty$. Then we have either $\int_A f(x)\; dx \le a \mu(A) < b \mu(A)\le \int_A g(x)\; dx$ or $\int_A f(x)\; dx \ge a \mu(A) > b \mu(A) \ge \int_A g(x)\; dx$.