Proof that $\sum_{n=0}^{\infty}(-1)^{n} = \frac{1}{2}$. Is there any error?

Always keep in mind that a proof that holds for any finite case need not hold in the infinite case. In the context of your proof, the following equality holds for any $n\in\mathbb{N}$: $$\int_a^xf\circ\log t\,dt=x\sum_{i=0}^n(-1)^if^{(i)}\circ\log x-a\sum_{i=0}^n(-1)^if^{(i)}\circ\log a+(-1)^n\int_a^xf^{(n+1)}\circ\log t\,dt,$$ which you can easily adapt your above proof to show via induction. However, this does not imply that the equality holds as $n\to\infty$, because $\infty$ is not a natural number - induction simply does not work in the infinite case. For your choice of $f=\exp$, we have on the right-hand side: $$\lim_{n\to\infty}\left[x\sum_{i=0}^n(-1)^i\exp x-a\sum_{i=0}^n(-1)^i\exp a+(-1)^n\int_a^xt\,dt\right]$$ but this limit does not exist for any value of $x$, since the sum $\sum_{i=0}^\infty(-1)^i$ diverges. Therefore, you can't extend this identity to the infinite case without checking that the sum on the right-hand side actually converges - otherwise the equality is meaningless.

However, when that series above does converge and the "remainder term" consisting of the integral on the right goes to zero, you can still use it to get some interesting results - for example, try taking $f:x\mapsto x^n$, and you can find a series expression for the following integral: $$\int_a^x\log^nt\,dt$$


Let $$ g_n(x)=\sum_{k=0}^n(-1)^kxf^{(k)}(\log(x))\tag1 $$ then $$ \begin{align} \frac{\mathrm{d}}{\mathrm{d}x}g_n(x) &=\frac{\mathrm{d}}{\mathrm{d}x}\sum_{k=0}^n(-1)^kxf^{(k)}(\log(x))\tag2\\ &=\sum_{k=0}^n(-1)^kf^{(k)}(\log(x))+\sum_{k=1}^{n+1}(-1)^{k-1}f^{(k)}(\log(x))\tag3\\[6pt] &=f(\log(x))+(-1)^nf^{(n+1)}(\log(x))\tag4 \end{align} $$ which gives $$ g_n(x)=\int f(\log(x))\,\mathrm{d}x+(-1)^n\int f^{(n+1)}(\log(x))\,\mathrm{d}x\tag5 $$ $g_n$ tends to a limit if $f^{(n+1)}$ vanishes uniformly on compact sets. In the example in the question, $f(x)=e^x$, it does not. Instead we get $$ g_n(x)=\frac{1+(-1)^n}2\,x^2+C_n\tag6 $$ Plugging $(6)$ into $(2)$ and dividing by $x$ gives $$ 1+(-1)^n=2\sum_{k=0}^n(-1)^k\tag7 $$ which is a true statement, but does not lead to the sum tending to $\frac12$.