If $ \lim_{x \to +\infty}f(x) = A $ and $ \lim_{x \to +\infty}f'(x) = B $, prove that $B = 0$ 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: 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$.
A: There are indeed several mistake here.
First, $B+1$ might not be positive, thus you cannot set $\epsilon = B+1$ and assume that it is a positive number.
Second, $|f'(x) - B| < B+1$ does not imply $1< f'(x)$. Instead you have
$$  -B-1 < f'(x) - B < B+1 \Leftrightarrow -1 < f'(x) < 2B+1.$$
In particular, you do not have $f'(x) \neq 0$.
Third, in the closed and bounded interval $[M+1, M+2]$, maximum/minimum might be attained at the endpoints $M+1, M+2$, so Fermat's theorem might not be applicable (note that in wikipedia, Fermat's theorem is applied to functions defined on open interval $(a, b)$).
A: Prove by contradiction. Suppose the contrary that $B\neq0$. Choose
$X_{1}>0$ such that $|f'(x)|>\frac{1}{2}|B|>0$ for all $x\geq X_{1}$.
Since $f(x)\rightarrow A\in\mathbb{R}$, there exists $M>0$ and $X_{2}>0$
such that $|f(x)|\leq M$ for all $x\geq X_{2}$. Let $X_{3}=\max(X_{1},X_{2})$.
Choose $x_{1},x_{2}\in[X_{3},\infty)$ such that $x_{2}-x_{1}>\frac{4M}{|B|}$.
By mean-value theorem, there exists $\xi\in(x_{1},x_{2})$ such that
$f(x_{2})-f(x_{1})=f'(\eta)(x_{2}-x_{1})$. On one hand,
\begin{eqnarray*}
|f(x_{2})-f(x_{1})| & = & |f'(\eta)(x_{2}-x_{1})|\\
 & > & \frac{1}{2}|B|(x_{2}-x_{1})\\
 & > & 2M.
\end{eqnarray*}
On the other hand,
\begin{eqnarray*}
|f(x_{2})-f(x_{1})| & \leq & |f(x_{1})|+|f(x_{2})|\\
 & \leq & 2M.
\end{eqnarray*}
We arrive a contradiction!
