Recall (Binomial Series)
#(1+x)^\alpha=\sum_{n=0}^\infty\frac{\alpha\cdot(\alpha-1)\cdot(\alpha-2)\cdot\cdots\cdot(\alpha-n+1)}{n!}x^n#
Let us look at #f(x)#.
#f(x)=\frac{1}{(1+x)^2}=(1+x)^{-2}#
By Binomial Series with #\alpha=-2#,
#=\sum_{n=0}^\infty\frac{(-2)\cdot(-3)\cdot(-4)\cdot\cdots\cdot(-n)\cdot(-(n+1))}{n!}x^n#
By factoring out the negative signs,
#=\sum_{n=0}^\infty(-1)^n\frac{\cancel{2}\cdot\cancel{3}\cdot\cancel{4}\cdot\cdots\cdot \cancel{n}\cdot(n+1)}{1\cdot\cancel{2}\cdot\cancel{3}\cdot\cancel{4}\cdot\cdots\cdot \cancel{n}}x^n#
By cleaning up,
#=\sum_{n=0}^\infty(-1)^n(n+1)x^n#
I hope that this was clear.