Let $$f(x,y)=\begin{cases} 1, & x \geq 0, x\leq y <x+1\\ -1, & x \geq 0, x+1 \leq y < x+2\\ 0, & \text{in other case} \end{cases}$$ Show that $$\iint f(x,y) d \lambda(y) d\lambda(x) \neq \iint f(x,y) d\lambda(x)d\lambda(y)$$ where $\lambda$ stands for the lebesgue measure.
I literally have no clue on how to solve this, but I'd really like some hint instead of a complete answer to help me solve problems similar like this one. Thank you!
Basically one just has to sit down and do the integrations. The first way round is easier. For a fixed $x$, $f(x,y)$ can only be nonzero if $x\ge0$. In that case, $f(x,y)=1$ for $y$ between $x$ and $x+1$ (so on an interval of length $1$) and $f(x,y)=-1$ for $y$ between $x+1$ and $x+2$ (so also on an interval of length $1$). It's zero for all other $y$. Thus $$\int f(x,y)\,dy=0$$ for any $x$, and so rather trivially then $$\iint f(x,y)\,dy\,dx=0.$$
The other way round has more cases. I'll just do one of them. If $0<y<1$, then $f(x,y)=1$ for $0\le x\le y$ and is zero otherwise. So, $$\int f(x,y)\,dx=y$$ if $0<y<1$. One then needs to delineate the other cases and work out the integrals, and then finally do the double integral.