Where am I going wrong with my proof $\int( \sin x +\cos x) dx=0$ Let's make the substitution $x=\frac{\pi}{2}-u$ to evaluate
$$I=\int (\sin x +\cos x) dx$$
After substituting, the integral becomes
$$
I=-\int (\cos u +\sin u)du=-I \implies I=0$$
What was wrong?

Imagine you have bounds on the integral:
$$I=\int_{a}^{b}sin(x) + cos(x)dx$$
Doing your substitution $u=\frac{\pi}{2} - x$ you get:
$$I=-\int_{\frac{\pi}{2}-a}^{\frac{\pi}{2}-b}{cos(u)+sin(u)}du$$
Note that the bounds of the integral changed. This is the fundamental problem with what you did. The bounds changing messes with the integral.
The problem with your proof is that you treated $I$ as a function, specifically the antiderivative of $\int{sin(x)+cos(x)}dx$. But that isn’t one specific function, it’s a set of functions, it equals
$$sin(x)-cos(x)+C$$
Where $C$ can be any number. So it’s hard to manipulate the antiderivative of a function because it isn’t necessarily one thing, it’s prone to cause weirdness. That’s why we usually make sure there are bounds on an integral when we set it equal to $I$
