# continues function and uniformly convergent

We were given that $f_n : [a,b] \to [c,d]$ function uniformly convergent to $f$, and $g:[c,d] \to \mathbb{R}$ is continues then $g o f_n$ uniformly converge to $g of$ and were asked to give a counter example when $g$ is not continues and another counter example when $[c,d]$ is open interval and not close

for the counter example when $g$ is not continues i used the example $f_n(x) = x n e^{-n}$ from $[0,1] \to [0,1/2]$ which is uniformly converges to $f(x)=0$ and $g :[0,1/2] \to \mathbb{R}$ such that $g(x)=0$ if $x=0$ and $g(x)=1$ otherwise and so $gof_n$ is not uniformly convergent to $gof$, is this example valid ?

also for a counter example with open interval $(c,d)$ i cant find a counter example, please help.

• Hint: $f_n$ need not to be continuous. – user251257 Apr 28 '18 at 10:48
• @user251257 for open interval $(c,d)$, we need to give a continues function, but it need not to be uniformly continues – Ahmad Apr 28 '18 at 10:51
• $g$ need to be continuous. There is no continuity assumption on $f_n$ or $f$. In fact, if $f$ is continuous, there is no counter example. – user251257 Apr 28 '18 at 10:54

Your first example is fine, but I wonder why you don't simply take $f_n(x)=1/n$ on $[0,1]$ (with the same $g$).
For the second part, let $$1_{\Bbb Q}(x)=\begin{cases}1&x\in\Bbb Q\\0&x\notin\Bbb Q\end{cases}$$ and consider $f_n\colon [0,1]\to (0,2)$, $x\mapsto \max\{1_{\Bbb Q}(x), x, \frac1n\}$. These converge uniformly to $f\colon[0,1]\to(0,2)$, $x\mapsto \max\{1_{\Bbb Q}(x),x\}$. Now let $g\colon (0,2)\to\Bbb R$, $x\mapsto \frac1x$. As $g\circ f$ is unbounded and all $g\circ f_n$ are bounded, there cannot be uniform convergence $g\circ f_n\to g\circ f$.
• I want to get $x$ involving, like any counter-example not involving $x$ seems shady to me, thanks for the quick answer – Ahmad Apr 28 '18 at 11:12
• That seems overly complicated. If the only reason to consider $1_{\mathbb{Q}}$ is to have $g(f(0))$ defined (so that the domain is a closed interval), why not just take $$\begin{cases} 1 & \text{for } x = 0 \\ 0 & \text{for } x > 0 \end{cases}$$ instead? – Adayah Apr 28 '18 at 11:16