Does the derivative of a continuous function goes to zero if the function converges to it?

Solution 1:

No, a counterexample is $$ \begin{eqnarray} g(x) &=& \frac{\sin(x^2)}{x} \text{,} \\ g'(x) &=& 2\cos(x^2) - \frac{\sin(x^2)}{x^2} \end{eqnarray} $$ $g$ obviously goes to zero as $x \to \infty$ but $g'(x)$ doesn't. In general, you need uniform convergence of the inner limit with respect to the outer one to swap the two. In the case of this counterexample, you don't have that.

(Technically, my counterexample is continuous only on $\mathbb{R}\setminus\{0\}$, but since you're interested only in $g$'s asymptotic behaviour, that doesn't really matter. You can obviously make it continuous on the whole real line by adjusting it on some interval around $0$, which won't change the asymptotic behaviour at all)

Solution 2:

No, it isn't enough. Let's consider \[ g(x) = \frac{\sin(e^x)}{1 + x^2} \] which goes to zero at infinity, but it's derivative \[ g'(x) = \frac{e^x\cos(e^x)(1+x^2) - 2x\sin(e^x)}{(1 + x^2)^2} \] doesn't.