What is the intuition behind why the integration of $f(x) = x$ for closed interval of negative to positive infinity diverges, rather than being zero?

This is because a choice was made in defining improper integrals, namely, we say an improper integral $$ \int_{-\infty}^\infty f(x)\mathrm dx $$ exists if the following limit $$ \lim_{m\to \infty}\int_{-m}^0f(x)\mathrm dx+\lim_{M\to \infty}\int_0^{M}f(x)\mathrm dx $$ exists.

Note that here we have two different limiting variables, meaning that $m$ and $M$ may be going to infinity at different speeds, potentially failing to perfectly cancel each other for each finite $m,M$ in the case of integrating an odd function like yours.

The definition you propose as intuitive is also a useful one, and is called the Cauchy Principal value integral. In this integral, the two limiting variables are the same.


By the same argument, we would have$$(\forall a\in\mathbb{R}):\int_{-\infty}^{+\infty}x+a\,\mathrm dx=0.$$But then$$0=\int_{-\infty}^{+\infty}x+a\,\mathrm dx=\int_{-\infty}^{+\infty}x\,\mathrm dx+\int_{-\infty}^{+\infty}a\,\mathrm dx=\int_{-\infty}^{+\infty}a\,\mathrm dx.$$I suppose that you see that there is a problem here.

And, as far as I know, nobody says that $\displaystyle\int_{-\infty}^{+\infty}x\,\mathrm dx=\infty$. People just say that the integral diverges.