I am looking for a continuous function with support compact, which its derivates are zero at zero, it means $f'(0)=0$,$f''(0)=0$..., I have seen this question All derivatives zero at a point $\implies$ constant function?. So, I know that one answers is a flat function but the difference is that I want a function such that $f(0)\neq0$ Maybe, that function is piecewise function or something different. I've tried to build it but I couldn't, any help, please?
2 Answers
Let $f_0(x)=0$ if $x \leq 0$, $f_0(x)=e^{-1/x}$ if $x >0$. It is pretty standard to note that $f_0$ is smooth.
Consider now $f_1(x)=\frac{f_0(1-x)}{f_0(1-x)+f_0(x)}$, $f$ is smooth, is $1$ when $x \leq 0$, and $0$ when $x \geq 1$.
Finally take $f(x)=f_1(x-1)f_1(-1-x)$. $f$ is smooth, $f(x)$ is zero as long as $x-1 \geq 1$ or $-1-x \geq 1$ (ie as soon as $|x| \geq 2$) and is one whenever $|x| \leq 1$, so $f^{(k)}(0) = 0$ if $k >0$, and $f(0)=1$.

- 34,439
A piecewise function could certainly work. For instance consider the function $f: \mathbb R \longrightarrow \mathbb R$ defined by $$f(x):=\begin{cases}1&\text{ if }x \in [-1,1] , \\2-x&\text{ if } x \in (1,2], \\ 2+x &\text{ if } x \in [-2,-1), \\ 0 &\text{ if } x \in (-\infty,-2) \cup (2, \infty).\end{cases}$$

- 4,446
-
1your function is not differentiable everywhere. – ersh Jan 15 '19 at 00:15
-
I am aware but I didn't consider this an issue because the question asker didn't ask for a function that is differentiable everywhere (just continuous). If this seems like an issue, then see Mindlack's more fancy example (I am lazy). – M A Pelto Jan 15 '19 at 00:31