TITLE: If $f_n \to f$ uniformly and $g_n\to g$ uniformly, then $f_n\circ g_n \to f\circ g$ uniformly?
QUESTION [5 upvotes]: Assume that $f_n, g_n$ are continuous. If $f_n \to f$ uniformly and $g_n\to g$ uniformly. Does it imply that $f_n\circ g_n \to f\circ g$ uniformly? I think it is true but I have no idea to prove it. Can anyone help me? Thank you in advance!

Edit: Is it true that $f_n\circ g_n \to f\circ g$ pointwise?

REPLY [2 votes]: Suppose that your domain is $[0,+\infty)$ and that $(\forall n\in\mathbb{N}):f_n(x)=\frac1x$ if $x\neq0$ and $f_n(0)=0$. Then $(f_n)_{n\in\mathbb N}$ converges uniformly to$$f(x)=\begin{cases}\frac1x&\text{ if }x>0\\0&\text{ otherwise.}\end{cases}$$ For each $n\in\mathbb N$, define$$g_n(x)=\begin{cases}x&\text{ if }x\geqslant\frac1n\\0&\text{ otherwise.}\end{cases}$$Then $(g_n)_{n\in\mathbb N}$ converges uniformly to $g(x)=x$. But$$f_n\bigl(g_n(x)\bigr)=\begin{cases}\frac1x&\text{ if }x\geqslant\frac1n\\0&\text{ otherwise,}\end{cases}$$which converges to $f$, but the convergence is not uniform.