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?

With an indefinite integral, you cannot simply treat the new variable after substitution as a dummy variable.
Let the primitive you get after integration be $F$.
So what you basically showed is that $F(x) = -F(u)$, which is completely correct once you work out the form of the primitive and put $u =\frac{\pi}{2} -x$.
Actually, there is another aspect to indefinite integration, and that's the constant of integration, which can change after a substitution. So what you really should write is that $F(x) +c_1 = -F(u)+c_2$ but that doesn't matter in this particular case because you'll find that $c_1 = c_2$. But in another case, they may be different.
You might be getting confused with definite integrals, where you have bounds (which also get transformed with the substitution). In that case, you can treat the variable of integration as a dummy variable and doing algebraic manipulations and comparisons as you did would be correct because the form of the primitive would be the same, and what you're asserting is $F(b) - F(a) = - (F(B) - F(A))$, where $a, b$ are the initial bounds and $A, B$ are the respective transformed bounds after the substitution.
