I was assigned a few problems in my Honors Calculus II class, and one of them was kind of interesting to do:

Suppose that $f_{n}$ are nonnegative bounded functions on $A$ and let $M_{n} = \sup f_{n}$. If $\displaystyle\sum\limits_{n=1}^\infty f_{n}$ converges uniformly on $A$, does it follow that $\displaystyle\sum\limits_{n=1}^\infty M_{n}$ converges (a converse to the Weirstrass $M$-test)?

I know that this question has been asked before, but I'm trying not to just copy an answer off the internet and instead to come up with an example of my own to see if I can actually understand the theorems that I'm learning.

To provide a counterexample, I tried to create a function which has a diverging $\sup$, but I'm not too confident that my proof is valid. Here it goes:

$$ \text Let \ f_{n}(x) = \begin{cases} \begin{cases} \frac{1 + x}{2}, & \text{if }x \in (-1,0]\\ \frac{1 - x}{2}, & \text{if }x \in (0,1)\\ 0, & \text{elsewhere} \end{cases}, & \text{if }n \text{ even}\\ \begin{cases} x, & \text{if }x \in (0,1]\\ 2 - x, & \text{if }x \in (1,2)\\ 0, & \text{elsewhere} \end{cases}, & \text{if }n \text{ odd} \end{cases} $$

Now, $\text Let f(x) = 0$.

From this definition, I can conclude that $$ \sup\{f_{n}\} = \begin{cases} \frac{1}{2}, & \text{if }n \text{ even}\\ 1, & \text{if }n \text{ odd} \end{cases} $$

Now, to show that ${f_{n}(x)}$ is uniformly convergent, the definition of uniform convergence is used:

$$ \forall_{\epsilon > 0}\ \exists_{N}\ \text s.t.\ \forall_{x}\ \text if\ n > N, |f(x) - f_{n}(x)| < \epsilon $$

Since $f_{n}(x)$ is strictly nonnegative and $f(x) = 0$, $|f(x) - f_{n}(x)| = f_{n}(x)$. By definition, $\epsilon > 0$, and since $f_{n}(x) = 0$ for $x \geq 2, f(x) - f_{n}(x) = 0 < \epsilon$ for $x \geq 2$. Therefore there exists a $N$ (namely, $N = 1$) which proves that the sequence is uniformly convergent.

Since $\lim_{n\to\infty} f_{n} \neq 0$, by the Limit Test, the infinite sum $\displaystyle\sum\limits_{n=1}^\infty \sup{f_{n}}$ diverges, which disproves the converse of the Weierstrass $M$-Test. $\blacksquare$

This is the first time I've actually used LaTeX, so I'm sorry for the way it looks. Is there anything that I can do to make this proof better (or even valid, if it's wrong), or is it fine the way it is?

This might be a bit of a long question...