Let (X,d) be a metric space. For each n $\epsilon$ N let $g_n$:X$\rightarrow$R be a continuous function. Let ($a_n$) be a sequence of positive real numbers such that the series $\sum_{n=1}^\infty a_n$ converges. Suppose that for a fixed M>0 we have |$g_n$(x)|$\leq$M$a_n$ for each x$\in$X and $n\in\mathbb{N}$. Show that the function g:X$\rightarrow$R defined by g(x)= $\sum_{n=1}^\infty g_n (x)$; x$\in $X is continuous.
This is a little different than Weierstrass M-test. I could not make the proof of Weierstrass M-test according to this question.
Since $|g_n(x)|\leq Ma_n, \ \forall n \in \mathbb N, \ x \in X$ and because the series $\displaystyle{\sum_{n=0}^\infty Ma_n}$ converges, from Weierstrass M-test the series $\displaystyle{\sum_{n=0}^\infty g_n(x)}$ converges uniformly on X.
Is a property of uniformly convergence that if $(f_n)_{n\in\mathbb N}$ uniformly converges to $f$ on $X$ and $f_n$ is continuous on $X, \ \forall n \in \mathbb N$ then $f$ is continuous on $X$.
Therefore $\displaystyle{g(x)=\sum_{n=0}^\infty g_n(x)}$ is continuous on $X$.