Problem: Let $ f: \mathbb{R} \to \mathbb{R} $ be a function of class $ C^1 $ such that $ \lim_{x \to +\infty}f(x) = A $ and $ \lim_{x \to +\infty}f'(x) = B $ for $ A, B \in \mathbb{R} $. Prove that $B = 0$.
I need help in validating my proof. Here it goes:
Suppose that $ B \neq 0 $. Take $ \epsilon = B+1 $. From the definition of limit to infinity, the following holds: $ (\exists M > 0)(\forall x > M) | f'(x) - B | < B+1 $
From there, $ 1 < f'(x) < 2B + 1 $ (for all x greater than M).
Now, take an interval $ [M+1, M+2] $. $ f $ is continuous on that segment, so it's bounded and reaches it's maximum and minimum. Function $ f $ is also differentiable on that segment, and if we apply Fermat's theorem (on local maximum/minimum), we'll get a contradiction, since $ f'(x) > 0 $ for all $ x \in [M+1, M+2] $. Therefore $ B = 0 $.
A possible solution is :
By the definition of the limit, there exists $M>0$ such that $|f'(x)-B|<\frac{|B|}{2}$ for $x\geqslant M$. We suppose without loss of generality that $B>0$ (otherwise consider $-f$), then for $x\geqslant M$, we have $f'(x)>B-\frac{|B|}{2}=\frac{B}{2}$. Thus, for $x\geqslant M$, $$ f(x)=f(M)+\int_M^xf'(t)dt\geqslant f(M)+(x-M)\frac{B}{2} $$ Taking the limit as $x\rightarrow +\infty$ gives that $\lim\limits_{x\rightarrow +\infty}f(x)=+\infty$.