Where did I went wrong $\int_{0}^{\infty}{\mathrm dx\over (1+x)^2}=0$? Consider

$$\int_{0}^{\infty}{e^{-x}\over 1+x}\mathrm dx=-eE_i(-1)=0.596347...\tag1$$
$$\int_{0}^{\infty}\left({1\over 1+x}-e^{-x}\right)\cdot{\mathrm dx\over 1+x}=eE_i(-1)=-0.596347...\tag2$$
$$\int_{0}^{\infty}{\mathrm dx\over (1+x)^2}=1\tag3$$

$E_i(x)$;Exponential integral
Here is the problem I am so confused with
$(1)+(2)$
$$\int_{0}^{\infty}{e^{-x}\over 1+x}\mathrm dx+
\int_{0}^{\infty}\left({1\over 1+x}-e^{-x}\right)\cdot{\mathrm dx\over 1+x}=0\tag4$$
Simplify $(4)$
$$\int_{0}^{\infty}{\mathrm dx\over (1+x)^2}=0\tag5$$
$(5)$ supposed to $\color{red}1$.
Why did I went wrong?

The value for integral (2) you wrote is not correct.  On $[0,\infty)$, we must have $(1+x)^{-1} \ge e^{-x}$, because $$e^x = \sum_{k=0}^\infty \frac{x^k}{k!} \ge 1 + x.$$  Thus, the integrand is strictly nonnegative for all $x \ge 0$.

In Mathematica (Version 10.4 on my system), the command
Integrate[(1/(1 + x) - Exp[-x])/(1 + x), {x, 0, Infinity}]

returns E ExpIntegralEi[-1] which then evaluated numerically gives a negative real number.  However,
NIntegrate[(1/(1 + x) - Exp[-x])/(1 + x), {x, 0, Infinity}]

gives 0.403653 which is correct.  I suspect the issue has to do with branch cut evaluation.  It may have been fixed in subsequent versions.  Note that the correct value can be evaluated symbolically with the command
Integrate[1/(1 + x)^2, {x, 0, Infinity}] - Integrate[Exp[-x]/(1 + x), {x, 0, Infinity}]

