Main Question.
Suppose $f:I\to\mathbb{R}$ is of class $C^n$, and suppose $f$ has a Taylor expansion of order $n+1$ at $a$ : does it follow that $f^{(n)}$ have a derivative at $a$? If not, what are some further assumptions one can impose on $f$ to make such a statement true?
Motivation.
Let $I$ be an interval, and let $a\in I$ be one of its points. Recall that $f:I\to\mathbb{R}$ is said to have a Taylor expansion of order $n$ at $a$ if there are real numbers $c_0,\dots,c_n$ such that $$f(x)=\sum_{k=0}^nc_k(x-a)^k+o_a\Big((x-a)^n\Big)$$ The following is a basic result about Taylor expansions :
Theorem 1a. Let $f:I\to\mathbb{R}$ be a function, then
- $f$ has a Taylor expansion of order $0$ at $a$ iff $f$ is continuous at $a$,
- $f$ has a Taylor expansion of order $1$ at $a$ iff $f$ has a derivative at $a$.
Analoguous statements are false for higher order Taylor expansions : even if $f$ has a Taylor expansion of order $n\geq 1$ at $a$, $a$ may be the only point in $I$ where $f$ is continuous, let alone differentiable.
Recall that Taylor expansions can be integrated :
Theorem 2. Let $F:I\to\mathbb{R}$ be differentiable, and let $f=F'$ be its derivative. Suppose $f$ has a Taylor expansion of order $n$ at $a$. Then $F$ has a Taylor expansion of order $n+1$ at $a$ which is given, as one might expect, by formally integrating the Taylor expansion of $f$ (and adding $F(a)$).
Let us define $$D^n(I)=\lbrace f:I\to\mathbb{R}\quad\text{ s.t. }\quad f',f'',\dots,f^{(n)}\text{ exist everywhere on }I\rbrace\,,$$ and two subsets $$D_aD^n(I)\subset C_aD^n(I)\subset D^n(I)$$ where $f\in D^n(I)$ belongs to $C_aD^n(I)$ iff $f^{(n)}$ is continuous at $a$, and to $D_aD^n(I)$ iff $f^{(n)}$ is differentiable at $a$. Note that $D^0(I)$ is the set of all functions $I\to\mathbb{R}$, $C_aD^0(I)$ the subset of those functions that are continuous at $a$, and $C_aD^0(I)$ the subset of those functions that are differentiable at $a$.
From Theorem 1a and Theorem 2 it easily follows, by successive integrations, that
Theorem 1b. Let $f\in D^n(I)$ be a function with derivatives up to order $n$
- if $f\in C_aD^n(I)$, then $f$ has a Taylor expansion of order $n$ at $a$, (EDIT : this, while true, follows from the next point, and continuity plays no role)
- if $f\in D_aD^n(I)$, then $f$ has a Taylor expansion of order $n+1$ at $a$.
And the coefficients in the Taylor expansion are, up to some factorials, $f(a),\dots,f^{(n)}(a)$ and $f^{(n+1)}(a)$.
For $n=0$, the converse holds : this is Theorem 1a, but for $n\geq 1$, he converse to both statments is false : there are differentiable functions such that $f(x)=o(x^2)$ at $0$, yet $f'$ isn't even continuous at $0$; something like $f(x)=x^3\sin(\frac1{x^{2}})$ will do.
Some calculations
Let us suppose $f$ is $C^n$ and has a Taylor expansion of order $n+1$, so that, for some $c_{n+1}\in\mathbb{R}$, \begin{array}{rcl} f(x) & = & \sum_{k=0}^n\frac{f^{(k)}(a)}{k!}(x-a)^k + \overbrace{\int_{a}^x\frac{(x-t)^{n-1}}{(n-1)!}\left[f^{(n)}(t)-f^{(n)}(a)\right]dt}^{=o((x-a)^n)}\\ & = & \sum_{k=0}^n\frac{f^{(k)}(a)}{k!}(x-a)^k+\frac{c_{n+1}}{(n+1)!}(x-a)^{n+1}+o_a\Big((x-a)^{n+1}\Big) \end{array} We take the difference and obtain $$\frac1{x-a}\int_{a}^x\left(\frac{x-t}{x-a}\right)^{n-1}\left[\frac{f^{(n)}(t)-f^{(n)}(a)-c_{n+1}(t-a)}{x-a}\right]dt=o_a(1)$$ which we can rewrite as $$\frac1{x-a}\int_{a}^x\left(\frac{x-t}{x-a}\right)^{n-1}\left[\frac{f^{(n)}(t)-f^{(n)}(a)-c_{n+1}(t-a)}{t-a}\right]\frac{t-a}{x-a}dt=o_a(1)$$ which can be rewritten as $$\int_{0}^1(1-u)^{n-1}\left[\frac{f^{(n)}((x-a)u+a)-f^{(n)}(a)-c_{n+1}(x-a)u}{x-a}\right]du=o_a(1)$$ Without loss of generality we may assume $a=0$, and setting $g(t)=f^{(n)}(t)-f^{(n)}(0)$, $g$ is may be any continuous function under the sun vanishing at $0$, and the hypothesis becomes $$\int_{0}^1(1-u)^{n-1}\left[\frac{g(xu)}{x}-c_{n+1}u\right]du=o_a(1)$$ and the question becomes
Suppose $c$ is a real number, and $g:\mathbb{R}\to\mathbb{R}$ is continuous, vanishes at $0$ and satisfies $$\lim_{x\to 0}\int_{0}^1(1-u)^{n-1}\left[\frac{g(xu)}{x}-cu\right]du=0$$ Can anything be deduced about differentiability of $g$ at $0$? Such as "$g$ is differentiable at $0$ and $g'(0)=c$?
Presumably the $(1-u)^{n-1}$ factor has no incidence on the result, and replacing $g$ by $h(t)=g(t)-ct$ we can further reduce the problem to the following
Suppose $h:\mathbb{R}\to\mathbb{R}$ is continuous, vanishes at $0$ and satisfies $$\lim_{x\to 0}\int_{0}^1\frac{h(xu)}{x}du=0$$ Is $h$ necessarily differentiable at $0$ with $h'(0)=0$?
The answer to this question is no : consider $h(x)=x(1-\delta(x))$ where $\delta(x)=\sum_{k=0}^\infty T_k(x)$, where $T_k$ is the piecwise affine tent function that is constant equal to zero outside of $[2^{-n}-\frac1{4^n},2^{-n}1\frac1{4^n}]$ and takes the value $1$ at $2^{-n}$.
Likely conclusion and new question
It seems likely that the answer to the question in this generality (that is : $f$ $C^n$ admitting a Taylor expansion of order $n+1$) is no, and the above should provide a counter example. However, it seems likely that the answer becomes yes if we assume $f^{(n)}$ to be $K$-lipschitz on some neighborhood of $0$ :
Suppose $h:\mathbb{R}\to\mathbb{R}$ is $K$-lipschitz, vanishes at $0$ and satisfies $$\lim_{x\to 0}\int_{0}^1\frac{h(xu)}{x}du=0$$ Is $h$ necessarily differentiable at $0$ with $h'(0)=0$?
Using the lemma below, and the reasoning sketched in the edit to the quesion, we can prove the following :
This lemma is certainly nothing new, but it took me a while to figure out a proof.
Proof. Let us define the (right) upper and lower Dini derivatives at $0$ as $$D^+=\limsup_{x\to 0^+}\;\frac{f(x)}{x}, \qquad D^-=\liminf_{x\to 0^+}\;\frac{f(x)}{x}$$ Clearly, since $f$ is $1$-Lipschitz we have $-1\leq D^-\leq D^+\leq 1$. It is enough to prove that $D^+=0=D^-$, and we will indeed prove $D^+\leq 0$; $D^-\geq 0$ will follow upon considering $-f$.
Let us suppose, on the contrary, $D^+$ to be positive, i.e. $D^+>0$. Let $\epsilon>0$ : then there is $\delta>0$ such that $$ \forall x\in\mathbb{R}^*_+,\quad\left(x<\delta\Longrightarrow\left|\int_0^1\frac{f(xu)}{x}du\right|<\epsilon\right) $$ By definition of $D^+$, there exists $0<x_\epsilon<\delta$ such that $$\frac{f(x_\epsilon)}{x_\epsilon}\geq\frac12 D^+.$$ Then, if we set $y_\epsilon=x_\epsilon-\frac12 D^+x_\epsilon$ and $\theta=\frac{y_\epsilon}{x_\epsilon}=1-\frac12D^+$ then $$ \begin{array}{rcl} \underbrace{\int_0^1\frac{f(xu)}{x}du}_{|\cdots{}|\leq\epsilon} & = & \int_0^\theta\frac{f(x_\epsilon u)}{x_\epsilon }du + \int_\theta^1\frac{f(x_\epsilon u)}{x_\epsilon }du\\ & = & \theta^2\underbrace{\int_0^1\frac{f(y_\epsilon u)}{y_\epsilon}du}_{|\cdots{}|\leq\epsilon} + \underbrace{\int_\theta^1\frac{f(x_\epsilon u)}{x_\epsilon }du}_{\geq\frac12\cdot{}\left(\frac12D^+\right)^2} \end{array}$$ The passage from $\int_0^\theta\frac{f(x_\epsilon u)}{x_\epsilon }du$ to $\theta^2\int_0^1\frac{f(y_\epsilon u)}{y_\epsilon}du$ is just scaling. The inequality $\int_\theta^1\frac{f(x_\epsilon u)}{x_\epsilon }du\geq\frac12\cdot{}\left(\frac12D^+\right)^2$ follows from $f$ being $1$ Lipschitz and comparing $f$ to the affine function with slope $1$ that takes on the value $\frac12 D^+$ at $1$ and equals $0$ at $\theta$.
Thus, $$ \frac12\cdot{}\left(\frac12D^+\right)^2\leq(1+\theta^2)\epsilon\leq 2\epsilon. $$ Sinc $\epsilon>0$ is arbitrary, we get $D^+=0$, which is a contradiction. Thus $D^+\leq 0$ and $D^+=0=D^-$ and $f$ differentiable at $0$ with $f'(0)=0$.
EDIT. Note that this proves the following :
This proposition applies to multivariable Lipschitz maps $u:\mathbb{R}^n\to\mathbb{R}$ as a means to prove the existence of directional derivatives. It is known (see for instance exercice 11.48, p.343, in Giovanni Leoni's A First Course in Sobolev Spaces) that multivariable Lipschitz function that have Gâteaux derivatives in a dense set of directions $D\subset\mathbb{S}^{N-1}$, and which satisfy the expected linearity relation $$\forall v\in D,\quad\frac{\partial u}{\partial v}=\sum_{i=1}^N\frac{\partial u}{\partial x^i}v^i$$ where $(x^1,\dots,x^N)$ are the coordinate functions relative to some basis $(e_1,\dots,e_N)$ of directions (in $D$), and $v=\sum_{i=1}^Nv^ie_i$, so that