$\exists f\in C^1$ such that $f(0)=0,\;f(x)>0\;\forall x>0$, but $f'\leq0$ for points near zero? The question is about the existence of a function $f:[0,+\infty),$ with $f\in C^1\left([0,+\infty)\right)$ such that
$$f(0)=0,\quad f(x)>0,\;\forall x>0,$$
and there is a strictly decreasing sequence $\{x_n\}_{n\in\mathbb{N}}\subset[0,1)$ with $\lim\limits_{n\rightarrow\infty}x_n=0$ such that
$$f'(x_n)\leq0,\;\forall n\in\mathbb{N}.$$
The exercise was about proving that such $f$ doesn't exist... but I failed in all my attempts.
Thanks in advance for any help!
 A: Such function does exist. Consider 
$$f(x):=x^3(2+\sin(1/x))$$
extended by continuity at $x=0$ (see a plot at WA). 
We have that $f\in C^1\left([0,+\infty)\right)$, $f(0)=0$, and $f(x)>0$ for  $x>0$. Moreover, there is a strictly decreasing positive sequence $\{x_n\}_n$ such that $x_n\to 0^+$ and $f'(x_n)<0$.
A: You can find non-trivial counter-examples for this. For every $n$, let $f_n:[1/(2n),1/(2n-1)]\to\mathbb{R}$ be a function that satisfies:

*

*$supp(f_n)\subseteq (1/(2n),1/(2n-1))$;

*$f_n'(x)<-2$ for some $x$;

*$\max_x |f_n(x)|<1/(2n)$
You can construct these functions by playing around with mollifiers and something like $e^{-1/(x^2)}$. You can see mollifiers here: https://en.wikipedia.org/wiki/Mollifier
The general idea is that it looks like this.
Now patch up all these functions: Let $g$ be equal to $f_n$ on each interval $[1/(2n),1/(2n-1)]$, and 0 everywhere else. The function $f(x)=g(x)+x$ has the properties you want and $f'(x_n)<-1$ for a sequence of point $x_n\in[1/(2n),1/(2n-1)]$

EDIT: This can be seen as a soft version of  Robert Z's answer
A: Set
$$
f(x)=x^{5/2}\left(2+\sin\Big(\frac1x\Big)\right)
$$
Then
a. $f(0)=0$ and $f(x)>0$, for all $x>0$.
b. $f'(x)=\frac{5}{2}x^{3/2}\left(2+\sin\Big(\frac1x\Big)\right)-x^{1/2}\cos\Big(\frac1x\Big)$, so for $x_n=\frac{1}{2n\pi}\to 0^+$ we have
$$
f'(x_n)=\frac{5}{2}(2\pi n)^{-3/2}\big(2+\sin(2n\pi)\big)-(2n\pi)^{-1/2}\cos(2n\pi)=5(2\pi n)^{-3/2}-(2\pi n)^{-1/2} \\ = (2\pi n)^{-1/2}\left(\frac{5}{2\pi n}-1\right).
$$
Observe that 
$$
f'(x_n)<0
$$
for all $n\in\mathbb N$.
A: Here's a $C^\infty$ example with this property:
$$f(x) = e^{-1/x}(2+ \sin(1/x^2)),\,\, x> 0,$$
$f(0)=0.$ Here you can check $f'(1/\sqrt {2n\pi})<0$ for $n=1,2,\dots$
However, there is no real analytic example with this property.
A: Hint: Take $f(x) = x^2, x_n \equiv 0$ and you are done.
edit: This answer was for a former version of this question. Now it's wrong obviously
