TITLE: $f$ is differentiable and $\lim_{x\to \infty }f(x)=\lim_{x\to -\infty }f(x)=0$
QUESTION [7 upvotes]: This is quiet a simple question, but still I'm not sure that I am correct.
Let $f$ be a differentiable function in $\mathbb{R}$ such that:
$\lim_{x\to \infty }f(x)=\lim_{x\to -\infty }f(x)=0.$
We need to prove that there is $a\in \mathbb{R}$ such that $f'(a)=0$.
If f is permanent, it is obvious.
If it is not, there must be a maximum or minimum. 
I know (Maybe I am wrong) that If the limits in $\infty$ and  $-\infty$ are final, so the function is  uniformly continuous by Kantor theorem, and then we may say that If it uniformly continuous it is bounded, and thus gets it minimum and maximum? (By weierstrass theorem?), and Finally we use Rolle' theorem.
Am I correct? Did I wake up the calculus masters for nothing? How would you answer this question?
Thank you

REPLY [8 votes]: If $f$ is not constant, the exists $x_0$ such that $f(x_0)\neq 0$. We can assume that $f(x_0)>0$ (if it's not the case we will consider $-f$). We use the definition of the limit for $\varepsilon =\frac{f(x_0)}2$. We can find $x_1$ and $x_2$ with $x_1<0<x_2$ such that $|f(x_1)|< \frac{f(x_0)}2$ and $|f(x_2)|<\frac{f(x_0)}2$.  Hence we have $f(x_1)< \frac{f(x_0)}2$ and $f(x_2)< \frac{f(x_0)}2$. By the intermediate value theorem we can find $y_1$ and $y_2$ with $x_1<y_1<x_0<y_2<x_2$ such that $f(y_1)=f(y_2)=\frac{f(x_0)}2$. Now we conclude by Rolle's theorem.

REPLY [7 votes]: Since this is trivial if $f$ is identically zero, suppose it is not. Thus $f(r) \neq 0$ for some $r \in \mathbb{R}$. Since $f$ is continuous and $\lim _{x \to \infty } f(x) = \lim _{x \to -\infty } f(x) = 0$, there  exist $r_1 < r$ and $r_2 > r$ such that $f(r_1)=f(r_2)$. Hence, since $f$ is everywhere differentiable, there exists some $a$ between $r_1$ and $r_2$ such that $f'(a)=0$.