Fallacy - where is the mistake? Could anyone help me to find the mistake in this fallacy? Because the actual result for $I$ is $\pi/2$
\begin{equation}
I = \int_{0}^{\pi} \cos^{2} x \; \textrm{d}x
\end{equation}
\begin{equation}
I = \int_{0}^{\pi} \cos x \cos x \; \textrm{d}x
\end{equation}
substitution:
\begin{equation}
\sin x = u
\end{equation}
\begin{equation}
\cos x \; \textrm{d}x = u
\end{equation}
\begin{equation}
\cos x = \cos (\arcsin x)
\end{equation}
and the limits:
\begin{align}
\begin{split}
x &= 0 \quad \Rightarrow \quad u=0 \\
x &= \pi \quad \Rightarrow \quad u=0
\end{split}
\end{align}
so
\begin{equation} 
I = \int_{0}^{0} \cos (\arcsin u) \textrm{d}u
\end{equation}
\begin{equation}
I=0
\end{equation}

You've messed something up...I can't quite see it, but this is how I would solve the problem:
\begin{equation}
I=\int_0^\frac{\pi}{2}\cos^2\left(x\right)dx=\int_{0}^{\frac{\pi}{2}}\left(\frac{1}{2}+\frac{\cos\left(2x\right)}{2}\right)dx
\end{equation}
via using the trigonometric identity. Your u-substitution is wrong btw...you cannot substitute $u=\sin\left(x\right)$ since there is no $\sin\left(x\right)$ in the integrand, and it isn't equivalent to anything either unless you change your bounds of integration which is pointless.
