TITLE: Is a continuous function that satisfies a certain condition uniformly continuous?
QUESTION [17 upvotes]: Let $f:[0,+\infty)$ be a continuous function that satisfies:
$f(x+q)$~$f(x)$ for $x\to\infty$ (for any $q$)
Does it follow that $f$ is uniformly continuous?
I have managed to show that if there exists $\space$ $\displaystyle\lim_{x\to\infty}\space f(x)=G\in\Bbb{R}$ $\space$ then the function must be uniformly continuos by for given $\epsilon$ picking an $N$ big enough that $\forall_{x>N} |f(x)-G|<\frac{\epsilon}{2}$ and then showing that the function is uniformly continuous on
$[0,N]$ and satisfies the definition of unifom continuity for that $\epsilon$ on $[N,+\infty)$, thus proving it must be uniformly continuous,since we could have chosen any $\epsilon$.
However, that approach fails when we consider the cases where $\displaystyle\lim_{x\to\infty}\space f(x)$ is infinite or non-existent.
I've also tried to find a counterexample by experimenting with functions like $\frac{1}{x}\sin(x^{3})$ (which appeared promising since its derivative is unbounded) but so far I haven't found one and my intuition does not steer me to either of the answers.
I would appreciate any hints :)

REPLY [14 votes]: Yes, it does.
Firstly, let us define the following set:
$$S_{\varepsilon,X} = \{t \in \mathbb R_{\geq 0} : \text{if }x\geq X\text{ then }|f(x+t)-f(x)| \leq \varepsilon\}.$$
By hypothesis, for any fixed $\varepsilon$, we have
$$\bigcup_{X\in\mathbb R_{\geq 0}}S_{\varepsilon,X} = \mathbb R_{\geq 0}.$$
Note that each set $S_{\varepsilon,X}$ is closed because for a fixed $x$, the set of values of $t$ such that $|f(x+t)-f(x)|\leq \varepsilon$ is closed and $S_{\varepsilon,X}$ is an intersection of these closed sets over all $x\geq X$.
Note that we could also say that
$$\bigcup_{X\in\mathbb Z_{\geq 0}}S_{\varepsilon,X} = \mathbb R_{\geq 0}.$$
since the sets $S_{\varepsilon,X}$ increase with $X$ - giving a countable union of closed sets whose union is the whole space.
We can then apply the Baire Category Theorem to say that since a countable union of closed sets has non-empty interior, some element of the union must have an interior! In particular, for any $\varepsilon>0$, there must be some $X$ such that some interval $(a,b)$ is a subset of $S_{\varepsilon,X}$. However, then if we have that $x,y \geq X + a$ and $|x-y| < |b-a|$ we could choose some pair $a',b'\in (a,b)$ with $x-a' = y-b'$ and then observe that
$$f(x)=f(x-a' + a')$$
$$f(y)=f(y-b' + b')$$
Then the distance from $f(x)$ to $f(x-a')$ is at most $\varepsilon$ as is the distance from $f(y)$ to $f(y-b')$ since $a',b'\in \subseteq S_{\varepsilon,X}$. Thus we find that if $x,y \geq X+a$ and $|x-y| < |b-a|$ we have $|f(x)-f(y)| \leq 2\varepsilon$ - and this works out for any choice of $\varepsilon>0$. This fact suffices to establish that $f$ is uniformly continuous with a small bit of further work.