To prove $f=0$ a.e under certain condition Suppose $f$  is real-valued  and integrable with respect to two dimensional Lebesgue measure on $[0,1]^2$. 
$$\int_0^a \int_0^b f(x,y) \, dy \, dx =0$$
for all $a\in [0,1], b\in [0,1]$.
Prove that $f=0$ a.e
I am stuck at this problem. What I can show I suppose is 
$$\int_a^b \int_c^d f(x,y) \, dx \, dy =0$$ for all $a,b,c,d \in [0,1]$. But then I don't know whether there is such theorem that say any open set in $[0,1]^2$ can be written as a disjoint union of squares or like that so that I can show that the integral is $0$ on any open set.
I don't know how to proceed. Thanks in advance for any help!
 A: Hint: Open sets in $\mathbb{R}^2$ are generated by products of open sets in $\mathbb{R}$. These, in turn, are generated by open intervals.

It might be that this is more complicated than it needs be, but try the following route:
$\quad (1)$: Using the hint above, show that $\int_A f=0$ on any open set $A\subset\mathbb{R}^2$.
$\quad (2)$: Argue by contradiction; suppose $\{x\,|\,f(x)\neq 0\}=\{x\,|\,f(x)> 0\}\cup\{x\,|\,f(x)<0\}$ has positive measure, so that without loss of generality $B=\{x\,|\,f(x)> 0\}$ has positive measure.
$\quad (3)$: Write $B=\bigcup B_n$, where $B_n=\{x\,|\,f(x)\geq\frac1n\}$.
There must be some $k$ with $\mu(B_k)>0$.
$\quad (4)$: Show that any measurable set $E$ can be approximated in measure by closed sets and by open sets.
In other words, for any $\epsilon >0$, there is


*

*a closed set $F\subset E$ with $\mu(E\setminus F)<\epsilon$; and

*an open set $\mathcal{O}\supset E$ with $\mu(\mathcal{O}\setminus E)<\epsilon$.


For each $\epsilon>0$, in the obvious notation let $F_\epsilon$ and $\mathcal{O}_\epsilon$ be such approximations of $B_k$.
$\quad (5)$: Consider $\mathcal{O}_\epsilon\setminus F_\epsilon$ and observe that it is open. We have that
$$\int_{B_k}f=\int_{\mathcal{O}_\epsilon}f-\int_{\mathcal{O}_\epsilon\setminus B_k}f$$
and
$$\int_{\mathcal{O}_\epsilon\setminus B_k}f=
\int_{\mathcal{O}_\epsilon\setminus F_\epsilon}f
- \int_{B_k\setminus F_\epsilon}f.$$
It follows that
$$\int_{B_k}f=\underbrace{\int_{\mathcal{O}_\epsilon}f}_{(*)}
-\underbrace{\int_{\mathcal{O}_\epsilon\setminus F_\epsilon}f}_{(**)}
+ \int_{B_k\setminus F_\epsilon}f$$
Now, by $(1)$, integrals $(*)$ and $(**)$ are both $0$.
Hence, $\int_{B_k}f=\int_{B_k\setminus F_\epsilon}f$, which implies $\int_{F_\epsilon}f=0$.
$\quad (6)$: On the other hand, notice that for $\epsilon$ small enough it must be that $\mu(F_\epsilon)>0$ and then the simple bound
$$\int_{F_\epsilon}f\geq \mu(F_\epsilon)\frac1k>0$$
contradicts our previous point.
A: As you point out, $\int_B f=0$ for each closed box $B=[a,b]\times [c,d].$  Now, note that every open set in $I\times I$ is a disjoint union of a countable collection of half-open boxes $\left \{ B_i:i\in \mathbb N \right \},\ $ and the Lebesgue measure assigns each its $2$ dimensional volume; that is, the same value as if the boxes were closed. Then, if $U\subseteq I\times I$ is open, $\int _Uf=\sum \int _{B_i}f=0$ by hypothesis plus the fact that $\nu:E\mapsto \int_Efd\lambda $ is a measure and so countably additive. 
Once we have this we can appeal to the Lebesgue density theorem:
$\lim_{r\to 0^{+}}\left [ \frac{\int_{B_r(x)}f(x)dx}{|B_r(x)} \right ]=f(x)\ a.e-\lambda$ which clearly applies because $I\times I$ is compact and $f$ is integrable. Each ball of radius $r$ is open so $\int_{B_r(x)}f(x)dx=0$ so $f(x)=0.$
If you don't want to use the big gun, then I think we can argue as follows:
Let $\epsilon>0$  and consider $E=\left \{ f> \epsilon  \right \}.$ There is an open set $U$ and a compact sets $K_n$ such that $K_n\subseteq E\subseteq U$ and $\lambda (E\setminus K_n)<1/n .$
Then, $\int_Ef=\int_Uf-\int_{U\setminus K_{n}}f+\int_{E\setminus K_{n}}f=0-0+\int_{E\setminus K_{n}}f\Rightarrow \int_{K_{n}}f=0$ and since $f>\epsilon$ on $K_n$ it must be that $\lambda (K_n)=0$ and this implies that $\lambda (E)=\lambda (E\setminus K_n)<1/n $ which is true for all $n$ and thus $\lambda (E)=0.$ As $\epsilon$ is arbitrary, it must be that $\lambda(\left \{ f>0 \right \})=0$. Applying the result to $g=-f$ is enough to show that $f=0$ a.e.-$\lambda.$
