What is wrong with this false proof of $\pi=0$?
What you should actually get is that $$I=\int_0^1 \frac1{x^2+1}dx+\int_{-1}^0 \frac1{x^2+1}dx$$ Then the substitution will give $$I=-\int_\infty^1 \frac1{u^2+1}du-\int_{-1}^{-\infty} \frac1{u^2+1}du$$
The flaw is in changing the integration interval.
$$-1\le x\le1\iff \frac1x\le-1\lor \frac1x\ge 1$$