TITLE: Continuity of a series of functions
QUESTION [6 upvotes]: $(a_n)$ a sequence of continuous function $a_n:\mathbb{R}\rightarrow\mathbb{R}$. Non-increasing, non-negative. If $\sum a_n(x)$ convergers for all $x$ then the function $g(x)=\sum a_n(x)$ is continuous.

EDIT: Call $g_n(x)=\sum_{k=0}^n a_n(x)$, this is continuous and $g_n(x)\rightarrow g(x)$.
$|g(x)-g(x_0)|\leq|g(x)-g_n(x)|+|g_n(x)-g_n(x_0)|+|g_n(x_0)-g(x_0)|$. The second addend is less than $\varepsilon$ if $|x-x_0|\leq\delta$, I want to estimate the first and third addend. Now
$|g(x)-g_n(x)|\leq\sum_{k=n+1}^\infty a_k(x)$ and because the series is convergent this is less that $\varepsilon$ if $n>n_1$. The same for the third addend if $n>n_2$. So if we take $N=\mathrm{max}\{{n_1,n_2}\}$ then we have the thesis. There sould be something wrong because I'm not using the hypothesis that the $a_n$ are non-increasing, could you help me to find the mistake?

REPLY [3 votes]: Nate has already pointed out the problem with your proof. Regarding a fix: Are you familiar with the Weierstrass $M$-test? One approach would be to use this, noting that $a_n(t)$ is majorized by $a_n(x)$ whenever $t\in[x,\infty)$. This will give you uniform convergence (hence continuity) on every interval $[x,\infty)$. (The proof of the Weierstrass test is extremely simple, and is given on the Wikipedia page I linked.)
Another approach would be Dini's theorem (again, very simple proof given on the Wikipedia page) on compact sets, using the fact that the difference $g-g_n=\sum_{k=n+1}^{\infty}a_n(x)$ is non-increasing in both $n$ and $x$.
As a side note, both of these theorems are very easily proved (i.e., no more difficult than solving this problem) and the ideas involved in the proofs come up very often in questions such as this one.