I want to construct an example of a function $f:\mathbb{R} \to \mathbb{R}$ with the following properties. By the way, I am not sure if it can exist.
- $f(0) = 0$
- $f'(0) < 0$
- $f$ is continuous at $x=0$
- $f'$ is not continuous at $x=0$
- There is a sequence $x_k$ converging to $0$ such that $f(x_k)=0$
The following famous example
$$ f(x) = \begin{cases} x^2 \sin(1/x) & x \neq 0 \\ 0 & x=0. \end{cases} $$
satisfies all the properties except $2$. I thought that modifying it like
$$ f(x) = \begin{cases} x^2 \sin(1/x) - x & x \neq 0 \\ 0 & x=0. \end{cases} $$
will make the derivative negative at $x=0$ but it destroys the property $5$. How should I construct such an example? Or maybe it does not even exist?
Such an example cannot exist. We would have $$0>f'(0)=\lim_{k\rightarrow\infty} \frac{f(x_k)-f(0)}{x_k-0}=\lim_{k\rightarrow\infty} \frac{0-0}{x_k}=0.$$ Meaning conditions $1,2$ and $5$ are not compatible.