Consider the function $f: \mathbb{R}^2\to \mathbb{R}$ defined by $$f(x,y):= \begin{cases} 1 \qquad x \geq 0,x \leq y < x + 1\\ -1 \>\quad x \geq 0,x + 1 \leq y < x + 2\\ 0 \qquad \text{else}\end{cases}$$
Then it is easy to verify that $$1 = \int_\mathbb{R}\left[ \int_\mathbb{R} f(x,y) d\lambda(x) \right]d\lambda(y) \neq \int_\mathbb{R}\left[ \int_\mathbb{R} f(x,y) d\lambda(y) \right]d\lambda(x) = 0$$ Now the question is why this does not contradict Fubini's theorem. My guess is that $f \notin \mathcal{L}^1(\mathbb{R}^2)$. Is this right? How do I prove this?