WLOG, we may suppose that $f(0) = 0$. Then I clam that $|f(x)| \le 1 + B|x|$.
By uniform continuity, there is $\delta > 0 $ such that for $|x - y| \le \delta$, $|f(x) - f(y) | \le 1$. Now take $B = \frac{1}{\delta}$. For any $x > 0$, we can piece together little intervals of size $\delta$ and by the above, the difference of $f$ on each interval is no more than $1$.
Doing it precisely, for $x > 0$, we take $k_x = [\frac{x}{\delta}]$, the greatest integer not exceeding $\frac{x}{\delta}$. Then
$$|f(x)| = |f(x) - f(0)| \le |f(x) - f(k_x \delta)| + \sum_{i=1}^{k_x} \left|f(i) - f((i-1) \delta)\right| \le 1 + k_x \le 1 + Bx$$
Symmetric arguments hold for $x < 0$ and so the result follows.