In answering this question we have used the following result.
Lemma If a measurable function $f \colon \mathbb{R}^n \to \mathbb{R}$ is such that, for every (compact) rectangle $R$,
$$\int_R f(x)\,dx=0,$$
then $f=0$ almost everywhere.
I'm pretty much sure this is true, both for recalling having read about it somewhere and for its intuitive obviousness. However, when cooking up a proof, I couldn't avoid making use of the additional assumption $f \in L^1_{\rm{loc}}(\mathbb{R}^n)$. You can read my try here (I've explicitly mentioned the point in which the additional assumption is exploited).
How to dispense with that?
EDIT: Answer to comments
In comments below Didier, Julian and Byron noted that the condition $\int_R f(x)\,dx=0$ on the rectangle $R$ implicitly says $f \in L^1(R)$. And so, requiring it to hold for every compact rectangle implies $f \in L^1_{\rm{loc}}(\mathbb{R}^n)$. Of course you're right: to sum things up, my question is totally trivial!!! :-)
I guess it is now universally clear that I'm a novice (still a student, in fact).
Thank you very much for helping.