Is a continuous function with zero “Taylor approximation” smooth?

Define the family of $C^\infty$ functions $$ \varphi_n(x)=\left\{\begin{array}{cl} 0&\text{for }x\le0\\ \frac{e^{\frac{n}{1-x}}}{e^{\frac{n}{x}}+e^{\frac{n}{1-x}}}&\text{for }0\lt x\lt1\\ 1&\text{for }x\ge1 \end{array}\right. $$ then $$ \varphi_n^\prime\!\left(\frac12\right)=2n $$ enter image description here

With $f(x)=e^{-\frac1x}$, and $x_k=\frac1k$, define $$ \begin{align} g(x) &=f(x_k)+(f(x_{k-1})-f(x_k))\,\varphi_{n_k}\!\!\left(\frac{x-x_k}{x_{k-1}-x_k}\right)&&\text{for }x_k\le x\le x_{k-1}\\ &=e^{-k}\left(1+(e-1)\varphi_{n_k}((k-1)(kx-1))\right)&&\text{for }\frac1k\le x\le\frac1{k-1}\\ \end{align} $$ enter image description here

$g$ is infinitely differentiable, monotonically increasing, and $g(x)\le e^{1-\frac1x}$.

For integer $k\ge1$, $$ g'\!\left(\frac1k\right)=0 $$ and for integer $k\ge2$, $$ g'\!\left(\frac12\left(\frac1{k-1}+\frac1k\right)\right)=2n_kk(k-1)(e-1)e^{-k} $$ If we set $n_k=3^k$, then $g'(x)$ varies between $0$ and $2k(k-1)(e-1)\left(\frac3e\right)^k$ on $\left[\frac1k,\frac1{k-1}\right]$. Thus, $g''(0)$ does not exist.


No, $f$ doesn't have to be infinitely differentiable at $0$: define $$f(x) = \int_0^x e^{-1/t^2}\left[1 + \sin (e^{1/t^2}) \right]dt$$ for $x \ge 0$ and $f(x) = 0$ for $x \le 0$.

$f$ satisfies the hypothesis, but $\lim_{x \to 0}f''(x)$ does not exist.