$f$ is continuous function on $[0, \infty)$, and the limit $\lim_{n \to \infty} \frac{f(x)}{x}= a \in \mathbb{R}$ exists. $f$ is uniformly continuous? I'm not sure how to prove or give a counter example to this. I wasn't able to prove it but I couldn't think of any counter example. Here's what I tried: By definition there exists $M>0$ such that for every $x>0$, $(a-1)x<f(x)<(a+1)x$. $f$ is uniformly continuous in $[0,M]$ (Cantor), but I'm not sure how to prove this for $(M, \infty)$. Can someone please help?
 A: No.
For a function to be uniformly continuous you can't have segments where the "rate of change" is arbitrarily large.
So for example, $f(x) = cos(x^2)$ is not uniformly continuous, because there are arbitrarily short segments where the function goes from $-1$ to $1$ ($[\sqrt{(2n-1)\pi},\sqrt{2n\pi}]$ for each $n$).
However, this does not constitute a counterexample because clearly $f(x)$ has no limit at infinity.
Alright, we can fix this, $f(x)$ is bounded so multiplying it by a vanishing function should do the trick, and indeed $g(x) = \frac{cos(x^2)}{x}$ vanishes at infinity.
This is no good either, because (as you can check) $g(x)$ has a bound derivative and therefore it is uniformly continuous.
The geometric meaning of this is essentially that multiplying by $1/x$ has tamed the rate of change so much that it is no longer arbitrarily fast. To overcome this, we need to make the rate of change even faster.
So we choose $h(x) = \frac{cos(x^3)}{x}$ (or, alternatively, make the decline to $0$ softer by choosing $h(x) = \frac{cos(x^2)}{\sqrt{x}}$), which, as you can readily check, is not uniformly continuous.
