# Continuity and uniform convergence counterexample

I have been having trouble finding a suitable counterexample to my problem, which I have written below.

For each $n\geq 1$, let $f_{n}\colon \mathbb{R}\to\mathbb{R}$ be a continuous function and suppose that the sequence of functions $(f_n)_{n=1}^\infty$ is uniformly bounded. If $f_n \xrightarrow[n \to \infty]{} f$ pointwise on $\mathbb{R}$, where $f\colon \mathbb{R}\to\mathbb{R}$ is continuous, can it be concluded that $f_n$ converges to to f uniformly on $\mathbb{R}$?

I think the answer is no, but I can't think of a counterexample. Thanks for any help in advance.

• When you write $f_n\to f$ it is good to identify the kind of convergence you have in mind. Do you mean pointwise convergence? If so, say so. – zhw. Apr 21 '16 at 21:47
• I just made the edit. Thanks. – shmiggens Apr 21 '16 at 21:47

No, take $f_n(x) = 1/(1+(x-n)^2)$ for example. Then $f_n\to 0$ pointwise on $\mathbb R,$ but $f_n$ does not converge to $0$ uniformly. Why? Because that would say $\sup_{\mathbb R} f_n \to 0.$ But $\sup_{\mathbb R} f_n =1$ for all $n.$
• the problem with that is you can have $0$ in the denominator – zhw. Apr 21 '16 at 22:03
Hint: Think of non-trivial continuous functions $f_n$ which are equal to $0$ on the complement of $[n,n+1]$ and bounded by $1$.
Choose some function $g : \mathbb{R} \to (0,1)$ that is surjective and continuous. Then define $f_n(x) = \big(g(x)\big)^n$. Now the sequence $\{f_n\}_{n=1}^\infty$ converges pointwise to $0$, but we have $\sup_{x\in\mathbb{R}} \: f_n(x) = 1$ for all $n \in \mathbb{N}$.
(Possible choices for $g$ are $\frac{1}{2} + \frac{\arctan(x)}{\pi}$ and $\frac{1}{1 + e^x}$; see also this question.)