Suppose that $f_n(x)$ uniformly converges to $f(x)$, i.e. $$ \sup_{x}|f_n(x)-f(x)|\rightarrow 0, \textrm{ as } n \rightarrow\infty. $$
For a continuous function $g$, can we prove that $g(f_n(x))$ uniformly converges to $g(f(x))$?
If yes, how to prove? If no, what conditions should we add to prove it?
Thank you very much!
If $g$ is merely continous, then the answer is negative. Example: $f_n(x)=x+\frac1n$ uniformly converges to $f(x)=x$ on $\mathbb R$, i.e., $$\sup_{x\in\mathbb R}|f_n(x)-f(x)|\to0,\qquad \text{as }\ \ n\to\infty.$$ Let $g(x)=x^2$, then $g$ is continuous on $\mathbb R$. We claim that $g\circ f_n$ does not converge to $g\circ f$ uniformly. Indeed, $$\sup_{x\in\mathbb R}|g(f_n(x))-g(f(x))|=\sup_{x\in\mathbb R}\left|2\frac xn+\frac1{n^2}\right|=\infty,\qquad \forall n\in\mathbb N.$$
If $g$ is uniformly continous, then things will be good!
Proposition. If $f_n$ converges uniformly to $f$ on a set $D$, and $g:I\to\mathbb R$ is uniformly continous, where $I$ is an interval such that $f_n(x),f(x)\in I$ for all $x\in D$ and $n\in\mathbb N$, then $g\circ f_n$ converges uniformly to $g\circ f$ on $D$.
Proof. Given $\epsilon>0$, we need to find $N$ such that $$\sup_{x\in D}|g(f_n(x))-g(f(x))|<\epsilon, \qquad \forall n>N.$$ By the uniform continuity of $g$, there is $\delta>0$ such that for all $y_1,y_2\in I$ with $|y_1-y_2|<\delta$ we have $|g(y_1)-g(y_2)|<\frac\epsilon2.$ Fix such $\delta>0$. Since $\sup_{x\in D}|f_n(x)-f(x)|\to0$, there exists $N$ such that $$\sup_{x\in D}|f_n(x)-f(x)|<\delta,\qquad \forall n>N.$$ Combining all things together, for any $\epsilon>0$, we have found $N$ such that $$|g(f_n(x))-g(f(x))|<\frac\epsilon2,\qquad \forall x\in D, \forall n>N;$$ taking supremum gives that $$\sup_{x\in D}|g(f_n(x))-g(f(x))|\leq\frac\epsilon2<\epsilon, \qquad \forall n>N.$$ This completes the proof.