CONTEXT
While self-studying Real Analysis I came across the following assertion, and tried to prove it.
PROBLEM
Let $f(x)$ be a differentiable function, defined in some right (left) neighborhood of $a$ (which can also be infinite). If $f'(x) = O(1)$ for $x\to a^+$ ($a^-$) then $f(x) = O(x)$ for $x\to a^+$ ($a^-$).
MY TENTATIVE PROOF
My proof makes use of a generalization of L'Hopital's Rule: if $f$ and $g$ are differentiable functions on a right neighborhood of $a$, $g'(x)\neq 0$ near $a$, and either $\lim_{x\to a^+} f(x) = \lim_{x\to a^+}g(x) = 0$, or $\lim_{x\to a^+}|g(x)| = +\infty$, then$$\liminf_{x\to a^+}\frac{f'(x)}{g'(x)} \leq \liminf_{x\to a^+}\frac{f(x)}{g(x)}\leq \limsup_{x\to a+}\frac{f(x)}{g(x)}\leq \limsup_{x\to a^+}\frac{f'(x)}{g'(x)}.\tag{1}\label{dlh}$$
Let us consider first the case $a = +\infty$ (or $-\infty$). Using $g(x) = x$ in \eqref{dlh}, and the hypothesis $f'(x) = O(1)$ for $x\to +\infty$ leads to
$$\limsup_{x\to +\infty}\frac{f(x)}x \leq \limsup_{x\to +\infty} f'(x) <+\infty,$$which immediately yields $f(x) = O(x)$.
Suppose now $a$ is finite. Then we must have$$-\infty < \liminf_{x\to a^+}f(x) = \limsup_{x\to a^+}f(x) < +\infty.$$If $\limsup f(x) \neq \liminf f(x)$, in fact, by the Mean Value Theorem the derivative would necessarily be unbounded. The same conclusion is reached if $f(x)$ diverges when $x$ approaches $a$. Define therefore$$L \equiv \lim_{x\to a^+} f(x),$$and$$f_1(x) = f(x)-L.$$Now we can apply \eqref{dlh} to $f_1(x)$ and $g(x) = x-a$, and reach again the conclusion that$$\limsup_{x\to a^+} \frac{f_1(x)}{x-a}\leq \limsup_{x\to a^+} f_1'(x) = \limsup_{x\to a^+}f'(x) < +\infty,$$implying that $f_1(x) = O(x)$, and therefore $f(x) = O(x)$, as desired.
QUESTIONS
Is the assertion correct? Is my proof correct? If the assertion is correct, can you suggest some alternative approaches to its proof? If it is not, can you provide me with (a hint to) a counterexample?