Why is it not true that $\int_0^{\pi} \sin(x)\; dx = 0$? I know the following is not right, but what is the problem. So we want to calculate 
$$
\int_0^{\pi} \sin(x) \; dx
$$
If one does a substitution $u = \sin(x)$, then one gets
$$
\int_{\sin(0) = 0}^{\sin(\pi) = 0} \text{something}\; du = 0.
$$
We know that $\int_a^a f(x) \; dx = 0$ for all functions $x$, so why doesn't this work for the above?
I get that the "something" "can't be found" because $du = \cos(x)\,dx$. But does it really matter what the $du$ is when one is integrating from $0$ to $0$?
Edit: I don't know what a "diffeomorphism" is. I am just in basic calculus.

Although there have been several great answers, one user suggested that I expand on a comment I wrote. To that end, we make the simple substitution 
$$x=
\begin{cases}
\arcsin (t)&,0\le x\le \pi/2\\\\
\pi-\arcsin(t)&,\pi/2\le x\le \pi
\end{cases}
$$
where the arcsine is taken to be the principal branch with domain $[-1,1]$ and range $[-\pi/2,\pi/2]$.  Then, we have
$$dx=
\begin{cases}
\frac{1}{\sqrt{1-t^2}}\,dt&,0\le x\le \pi/2\\\\
-\frac{1}{\sqrt{1-t^2}}\,dt&,\pi/2\le x\le \pi
\end{cases}
$$
Finally, the integral of interest becomes
$$\begin{align}
\int_0^\pi \sin x\,dx&=\int_0^{1} \frac{t}{\sqrt{1-t^2}}\,dt+\int_{1}^{0}\frac{-t}{\sqrt{1-t^2}}\,dt\\\\
&=2
\end{align}$$
and we are done!
