I'm trying to work out a question of a past exam, but I can't seem to figure it out. If I could get some help, I would be very appreciative. The question is:
Prove the following statement or provide a counter example, including an explanation of why it's a counterexample: If $f_n(x)$ is a continuous function on $[0,1]$ for each $n=1,2,\dots,$ and $0\leq f_n(x)\leq 1,$ for every $n\in N$ and every $x\in[0,1]$, then $f(x)=\sup_{n\in N} f_n(x)$ is a continuous function on $[0,1]$.
Thank you in advance.
This statement is not true. Take the following functions as a counterexample:
$$f_n(x)= \begin{cases} 0 & 0≤x<\frac 12 -\frac {1}{n+1} \\ \frac{n+1}{2}x-\frac{n-1}{4} & \frac 12 -\frac {1}{n+1}≤x<\frac12+\frac{1}{n+1} \\ 1 & \frac 12 -\frac {1}{n+1}≤x≤1 \end{cases} $$
Then
$$f_n(x)= \begin{cases} x & 0≤x<\frac 12 \\ \frac 12 & x=\frac12 \\ 1 & \frac 12 <x≤1 \end{cases} $$
which is clearly not continuous at $x=\frac 12$