Example : Iterated integral and Fubini Theorem Let $X = Y = \mathbb{R}$ and let $\mathscr{B}$ be the Borel $\sigma$-algebra. Define $$f(x,y) = 1 \ \mbox{if} \ x \geq 0, x \leq y < x+1,\ \\ \, \, \, = -1 \ \mbox{if} \ x \geq 0, x+1 \leq y < x+2, \\= 0 \ \mbox{otherwise}.$$
Show that $$\int\int f dxdy \neq \int\int fdydx.$$ Does this contradicts Fubini Theorem ?
For the fubini part, I think that $$\int\int |f| d(m \times m)(x,y) = \int\int_A 1 d(m \times m)(x,y) (= \ \mbox{area under} A) = \infty $$ where $A = \{(x,y) | x \geq 0, x \leq y < x+2\}$.
So this function is not non-negative and not Lebesgue integrable (which is required assumption for applying Fubini's Theorem). 
The first problem : Is there a better way to argue that the above double integral is infinity than saying that the integral represent the area of $A$ ? (I do not sure how to calculate double integral). 
The second is about showing that $$\int\int f dxdy \neq \int\int f dydx.$$
I find that $$\int\int_{\mathbb{R}^2} f dydx = \int_0^\infty \int_x^{x+1} 1 dydx + \int_0^\infty\int_{x+1}^{x+2} -1 dydx = \infty - \infty $$ which is not really defined. So what is $$\int\int f dydx = ?.$$ Or I just say the integral cannot be calculated ? (I think that $\int\int |f| dydx = \infty$. So this function is not even Lebesgue integrable. In this case, how to talk about $\int\int f dydx$ ?) 
 A: For Fubini's theorem to hold, we must have $f\in L^1(\mathbb R^2)$, that is
$$\iint |f(x,y)|\ \mathsf d(x\times y)<\infty. $$
But here we have
\begin{align}
\iint |f(x,y)|\ \mathsf d(x\times y) &= \iint|\chi_{[0,\infty]\times[x,x+1)}(x,y)-\chi_{[0,\infty]\times [x+1,x+2)}(x,y)|\ \mathsf d(x\times y)
\end{align}
Since $[0,\infty]\times[x,x+1)$ and $[0,\infty]\times[x+1,x+2)$ are disjoint for all $x$, the above integral is equivalent to
$$\iint\chi_{[0,\infty]\times[x,x+1)}(x,y)\ \mathsf d(x\times y) - \iint\chi_{[0,\infty]\times[x,x+1)}(x,y)\ \mathsf d(x\times y), $$
and both of these integrals are infinite, so this is of the form $\infty-\infty$ and $f\notin L^1(\mathbb R^2)$. As for the iterated integrals, we have
\begin{align}
\iint f\ \mathsf dy\ \mathsf dx &= \int_0^\infty\int_0^\infty \left(\chi_{[x,x+1]}(y)-\chi_{[x+1,x+2]}(y)\right)\ \mathsf dy\ \mathsf dx\\
&= \int_0^\infty\left[\int_x^{x+1}\ \mathsf dy - \int_{x+1}^{x+2} \ \mathsf dy \right]\mathsf dx\\
&= \int_0^\infty 0\ \mathsf dx\\
&=0
\end{align}
and integrating in the opposite order yields some finite number $c$ (for $x,y<2$) plus
\begin{align}
\int_2^\infty \left[ \int_{y-1}^y\ \mathsf dy - \int_{y+1}^y\ \mathsf dt\right]\mathsf dy &=
\int_2^\infty (x-(x-1) -(x+1)+x)\ \mathsf dx\\
&= \int_2^\infty 0\ \mathsf dx\\
&= 0.
\end{align}
The value of the integral is then
\begin{align}
c &= \iint\limits_{[0,2]\times [0,2]}f(x,y)\ \mathsf d(x\times y)\\
&= \iint (\chi_{[0,y)\times[0,1]}(x,y) + \chi_{[1,y-1]\times[1,2]}(x,y) - \chi_{(0,y]\times[1,2]}(x,y) +\chi_{[1,y]\times[1,2]}(x,y))\ \mathsf d(x\times y)\\
&= \frac12 + \frac12 - \frac12 + \frac12\\
&= \frac32.
\end{align}
