I have the givens: $$[a,b], [c,d] \subseteq \mathbb{R}\quad f_n:[a,b]\longrightarrow [c,d] \quad g:[c,d] \longrightarrow \mathbb{R}$$ $g$ is continuous and $f_n$ is uniformly converge on $[a,b]$ to $f$. I need to prove that $h_n=g(f_n(x)) is$ is uniformly converge to $h=g(f(x))$ on $[a,b]$
I showed that because $g$ continuous so according to heine deffinition $\lim_{n \to \infty} g(f_n(x))=g(f(x))$. from here I wrote $\lim_{n \to \infty}\sup|g(f_n(x))-g(f(x))|=0.$
The thing is I am not sure if I can argue the last equation, because I "bring" $n$ to infinity after I found the supremum.
Just because, for each individual $x$, you have $\lim_{n\to\infty}\bigl|g\bigl(f_n(x)\bigr)-g\bigl(f(x)\bigr)\bigr|=0$, you cannot jump to $$\lim_{n\to\infty}\sup_{x\in[a,b]}\bigl|g\bigl(f_n(x)\bigr)-g\bigl(f(x)\bigr)\bigr|=0.$$
Note that, since the domain of $g$ is an interval which is closed and bounded, $g$ is uniformly continuous. Now, take $\varepsilon>0$. There is a $\delta>0$ such that$$|x-y|<\delta\implies\bigl|g(x)-g(y)\bigr|<\varepsilon.$$And there is a $N\in\Bbb N$ such that$$n\geqslant N\implies(\forall x\in[a,b]):\bigl|f_n(x)-f(x)\bigr|<\delta,$$since $(f_n)_{n\in\Bbb N}$ converges uniformly to $f$. So, if $n\geqslant N$ and if $x\in[a,b]$, then$$\bigl|g\bigl(f_n(x)\bigr)-g\bigl(f(x)\bigr)\bigr|<\varepsilon.$$