Consider $\mathbb{R}$.
$f(x)=(-1)^nn,\ x\in A_n,\text{ and }A_n=\left(\frac{1}{n+1},\frac{1}{n}\right].$ Compute $\displaystyle\int_{\bigcup_{n=1}^\infty A_n}f \, dx $
$\sum_{k=1}^\infty \int_{A_n}f=-1(1/2)+2(1/6)-3(1/2)+\cdots,\tag{1}$ This series converges, so I would say the the function is integrable. Is there a way to evaluate (1) without resorting to geometry? Can one be more thorough? Is there a closed form integral for $f$?