# Continuous function as pointwise limit but not as uniform limit of a sequence of continuous functions on $[0,1]$

I recentaly find an article where it is said that there is a sequence of continuous functions $$\{f_n:[0,1]\rightarrow\Bbb R\}_{n\in \Bbb N}$$ that converges pointqise almost everywhere to zero function , but not converges uniformly.

My question is the following :--

Let $$f:[0,1]\rightarrow \Bbb R$$ be continuous , does there always exists a sequence of continuous functions $$\{f_n:[0,1]\rightarrow\Bbb R\}_{n\in \Bbb N}$$ such that $$f_n\rightarrow f$$ pointwise, but not uniformly on $$[0,1]$$.

Yes, there is always such a function.

Take a sequence of continuous functions $$g_n$$ which converges pointwise, but not uniformly, to $$0$$. Then $$f_n=f + g_n$$ converges pointwise, but not uniformly to $$f$$.

For an example of such $$g_n$$, you can take the following: $$g_n(x) = \cases{ nx & if x< \frac1n\\ 2-nx & if \frac1n \leq x < \frac2n\\ 0& otherwise}$$ The graph of $$g_n$$ will be a triangle starting at $$(0,0)$$, going up to $$(1, \frac1n)$$, then down to $$(\frac2n, 0)$$, and then flat horizontal from there. This does converge pointwise to $$0$$ (as at any non-zero point $$a\in [0,1]$$, eventually $$\frac2n, and $$g_n(a) = 0$$), but not uniformly, as it always has a maximum value of $$1$$.

• Heh, the exact same answer up to the letter used in order to avoid duplication of $f_n$ :) – 5xum Dec 12 '18 at 13:33
• @5xum I gues it's pretty standardized how one makes the "trivial" examples. – Arthur Dec 12 '18 at 13:38

Let $$g_n$$ be the sequence that converges almost everywhere to $$0$$, but does not converge uniformly (we already know that exists).

Let $$f$$ be a continuous function.

Then, $$f_n=f+g_n$$ converges almost everywhere to $$f$$, but does not converge uniformly.