Convergence of uniformly continous functions to a uniformly continous function

proof-verificationreal-analysissequences-and-seriesuniform-continuityuniform-convergence

Say $f_n,f:\mathbb{R} \to \mathbb{R}$ are uniformly continous functions a $f_n\to f$ pointwise.

Is the convergence nessecarily uniform?

I couldn't find an appropriate counter-example for this case so I tried proving it :

We have $|f_n(x)-f_n(y)|<\epsilon/3$ for all $|x-y|<\delta_1$, also $|f(x)-f(y)|<\epsilon/3$ for $|x-y|<\delta_2$ and for all $n>N_x$ we have $|f_n(x)-f(x)|<\epsilon /3$.

Overall for any $|x-y|<\delta=min(\delta_1,\delta_2)$ and any $n>N_x$ we have $|f_n(y)-f(y)|\leq |f_n(y)-f_n(x)|+|f_n(x)-f(x)|+|f(x)-f(y)|<\epsilon $ for any $y\in (x-\delta,x+\delta)$ and for any $x\in A\subset\mathbb{R}$.

Now if $A$ is compact, we have a cover of $A$ and we can choose a finite subcover $U$, and take $N=max\{N_x|x\in U\}. $ and for all $n>N$ we have $|f_n(y)-f(y)|<\epsilon$ uniformly .

However, if my proof is correct I have only proven uniform convergence in compact sets, and not on the entire number line. Can my proof be modified so we can get uniform convergence on $\mathbb{R}$? Or can someone provide a counter example where it fails in this case?

Edit: Thanks to the counter-examples in the answers I can see my proof is false. Can anyone point out where my proof fails?

Best Answer

I'll give an example on $\mathbb{R}$. Take the sequence $f_n(x)=\frac{x}{n}$. All the functions are uniformly continuous, the limit function is the zero function which is also uniformly continuous. But I say there is no uniform convergence here. Take $\epsilon=1$. For any index $n_o\in \mathbb{N}$ you can take $n=n_0+1$ and $x=2n$ and you will get $|\frac{x}{n}-0|=2 \geq 1=\epsilon$. Hence there is no uniform convergence.