A mathematical fallacy concerning the integrability of a function and cancellation

Consider the function $f(x)=\frac{1}{x}$ for $x \neq 0$ and $f(0)=0$. You can show that $f$ is not integrable on $[0,1]$. The statement in your question tells us $f$ is not integrable on $[-1,1]$. One might argue that because $f$ is an odd function and $[-1,1]$ is centered at the origin, the positive and negative area "cancel out" and $\int_{-1}^1 f(x)dx=0$ (similarly to how $\int_{-\pi}^\pi \sin(x)dx=0$), but this would be incorrect.


For example, $\int_{-\infty}^\infty x \; dx$ is not $0$ (except in the Cauchy principal value sense).