The question is to evaluate $S=\sum_{k=0}^{n} \frac{(-1)^k}{k+1} {n \choose k}$
$\textbf{My Attempt:}$ I have considered the generating function $$ f(x)=\sum_{k=0}^{n} {n\choose k} x^k = (x+1)^n$$Integrated and divided by $x$, $$\frac{1}{x} \int f(x) = \int \frac{{n \choose k}}{k+1} x^k = \left( \frac{1}{x} \right) \frac{(x+1)^{n+1}}{n+1}$$ Finally I considered the value for $x=-1$ which turns out to be $$\frac{1}{-1} \int f(-1) = \left( \frac{1}{-1} \right) \frac{(-1+1)^{n+1}}{n+1}=0$$ Which is wrong. I cannot spot my error
You forgot that indefinite integration is only defined up to an additive constant. You can find that constant by substituting some value at which the function is easy to evaluate. In this case, the sum you want is $0$ at $x=0$, so you actually get
$$ \frac1x\left(\frac{(x+1)^{n-1}-1}{n+1}\right)\;, $$
and then substituting $x=-1$ yields $\frac1{n+1}$ as expected.
Alternatively, you could use the definite integral from $0$ to $1$, which would yield the subtracted term at the lower limit.