# How do I show $f(x)$ is uniformly continuous.

Let $$f:\mathbb{R} \rightarrow \mathbb{R}$$ be a continuous with the following property: for every integer $$n$$, and every $$x,y \in \mathbb{R}$$ such that $$|x|+|y|>n^2$$ and $$|x-y|<\frac{1}{n^2}$$, we have $$|f(x)-f(y)| <\frac{1}{n}$$. Show that $$f$$ is uniformly continuous.

If I choose a set $$A=\{(x,y)\in \mathbb{R} \times \mathbb{R}||x|+|y|>n^2$$ and $$|x-y|<\frac{1}{n^2}$$}. Define a function $$g(x,y)=\frac{|f(x)-f(y)|}{|x-y|}$$. Clearly, $$g$$ is a continuous function. If $$A$$ is compact then $$g$$ is uniformly continuous. How do I show the compactness of $$A$$?

• $A$ is an open set; it can't be compact. – B. Goddard Aug 1 at 13:33

Let $$n>1$$, be an integer, the restriction of $$f$$ $$[-n^2,n^2]$$ is uniformly continuous since it is compact. There exists $$c$$ such that for $$x,y\in [-n^2,n^2]$$ such that $$|x-y| implies that $$|f(x)-f(y))|<{1\over n}$$, let $$d=inf(c,{1\over n^2})$$ and
$$x,y\in\mathbb{R}$$, if $$x$$ is not an element of $$[-n^2,n^2]$$, $$|x|+|y|>n^2$$ and $$|f(x)-f(y)|<{1\over n}$$.
If you take any integers $$x,y$$ either $$x,y\in [-n^2,n^2]$$ or either $$|x|>n^2$$ or $$|y|>n^2$$.