Show $f$ is uniformly continuous. Let $f$ be continuous on $\Bbb{R}$ and let $\lim_\limits{x\to \infty}f(x)-ax=\lim_\limits{x\to -\infty}f(x)-ax=0$ where $a\in \Bbb{R}$. Show $f$ is uniformly continuous. I did have an attempt but it has some flaws in it. The only thing that is still okay, I suppose, is that, looking at first at $[0,\infty)$, there is $M\in \Bbb{R}$ such that $\forall x>M, |f(x)-ax|<{\epsilon\over 2}$ (Or something like that.) It also includes saying that $f$ is uniformly continuous at $[0,M]$. I would appreciate your help. 
 A: Just like your idea, you can break up the real line into two parts: One a compact interval of the form $[-y,y]$ and the other part the rest of the real line. A continuous function on a compact set is uniformly continuous, and if you choose $y$ large enough then your function will always be within $\epsilon/3 > 0$ of $ax$ on the second subset, so you can use uniform continuity of the function $ax$ on the second subset, again with the value $\epsilon / 3$. Then use the triangle inequality to get that the values of the function are within $\epsilon$. The only thing that makes this look a little shady is that you keep choosing larger and larger $y$ as $\epsilon \to 0$, so your compact intervals are getting larger and larger, but this is still fine because all you have to say is that you can find SOME $\delta > 0$ that works for a particular $\epsilon > 0$.
A: I think you've made a good start.
I'm pretty rusty, so this is an exercise for me as much as you, and what follows may be too messy. Caveat emptor!
That said, my suggestion would be to carry on with the division into two cases that you have started with, but modify it slightly, as follows:
You've got your $M$, depending on some arbitrarily given $\epsilon$. So you can explicitly calculate, in terms of $\epsilon$ and $a$, a $\delta_1 > 0$ such that if $|x|$, $|y|$ are both $> M$, and $|x - y| < \delta_1$, then $|f(x) - f(y)| < \epsilon$.
Now you need only worry if one or other of $|x|$, $|y|$ is $\leqslant M$. So, instead of $[0, M]$ or $[-M, M]$, consider $[-M - \delta_1, M + \delta_1]$; and now you need only worry if both  $|x|$, $|y|$ are $\leqslant M + \delta_1$.
But you've already taken care of that case, essentially, so you can finish the proof from there.
In more detail:
Choose $M > 0$ so that $|f(x) - ax| < \epsilon/4$ whenever $|x| > M$.
(I think I usually stick all these "$\cdots/4$", "$\cdots/2$" bits in after writing more of the proof. Anyway, that's what I'm doing now.)
If $|x| > M$ and $|y| > M$, then $||f(x) - f(y)| - |ax - ay|| \leqslant |(f(x) - f(y)) - (ax - ay)| < \epsilon/2$, so $|f(x) - f(y)| < |a|\cdot|x - y| + \epsilon/2$.
You'll need to judge whether to write that part of the argument out in more or less gory detail than I've just done, because - presumably (I don't have much experience of handing in formal work!) - different instructors vary in what they expect.
So if we chose $\delta_1 > 0$ so that $|a| \cdot \delta_1 \leqslant \epsilon/2$ (careful what you write, in case $a = 0$!), then we have  $|f(x) - f(y)| < \epsilon$ whenever $|x| > M$ and $|y| > M$ and $|x - y| < \delta_1$.
Now choose $\delta_2 > 0$ so that $|f(x) - f(y)| < \epsilon$ whenever $|x| \leqslant M + \delta_1$ and $|y| \leqslant M + \delta_1$ and $|x - y| < \delta_2$. You can do this, because the interval $[-M - \delta_1, M + \delta_1]$ is compact.
(I don't know if you'll be expected to use that particular terminology, but you know about uniform continuity on bounded closed intervals.)
But for any $x, y \in \mathbb{R}$ such that $|x - y| < \delta_1$, we have either (i) $|x| > M$ and $|y| > M$, or else (ii) $|x| \leqslant M + \delta_1$ and $|y| \leqslant M + \delta_1$.
(Prove it! Don't just take it as obvious. But the obviousness of it helps with constructing the proof.)
And now we're practically done. Take $\delta = \min\{\delta_1, \delta_2\}$, and write your conclusion.
