Is a differentiable multivariable function with continuous derivatives on analytic paths continuously differentiable? Let $f: \mathbb R^n \rightarrow \mathbb R$ be an everywhere differentiable function; and continuously differentiable when restricted to any analytic path.
Is then $f$ continuously differentiable?
I would bet on no, but I failed to construct a counter-example in a reasonable time.
But maybe I am overthinking, and there should be a way to show the continuous differentiability?
This problem came to me from my research: I found myself in a company of a functional, which is smooth outside of some codimension 1 piecewise-analytic set. I was able to show that over this set the functional is differentiable. It was also clear that its restriction to any analytic path was nice. So I started wondering whether I can rely on that my functional friend is $C^1$.
 A: Theorem. Let $U$ be an open set of $\mathbf{R}^d$ and $f:U \to \mathbf{R}.$ In order for $f$ to be continuously differentiable on $U,$ it is necessary and sufficient that each of the partial derivatives of $f$ exist and be continuous on $U.$
Proof. Let $h \in \mathbf{R}^d.$ Write $h^0 = 0$ and $h^j = (h_1, \ldots, h_j, 0, \ldots, 0),$ so that $h^d = h.$ Obviously, the only candidate that can be derivative of $f$ is the linear function
$$
k \mapsto \nabla f(p) \cdot k = \sum_{j = 1}^d \partial_j f(p) \cdot k_j.
$$
We are going to show that this function actually satisfies the definition of derivative.
Then, we have to show that
$$
f(p + h) - f(p) - \sum_{j = 1}^d \partial_j f(p) \cdot h_j = \sum_{j = 1}^d \Big( f(p+h^j)-f(p+h^{j-1}) - \partial_j f(p) \cdot h_j \Big)
$$
is a $o(h)$ function (this will prove that the derivative of $f$ is given by the partial derivatives, as expected, and since the latter are continuous functions, by hypothesis, the former is also continuous).
By the mean value theorem and since the partial derivatives exists everywhere on $U$,
$$
f(p + h^j) - f(p+h^{j-1}) = \partial_j f(p+h^{j-1}) h_j.
$$
Therefore,
$$
f(p + h) - f(p) - \sum_{j = 1}^d \partial_j f(p) \cdot h_j = \sum_{j = 1}^d \Big( \partial_j f(p + h^{j-1}) - \partial_j f(p) \Big) h_j
$$
By continuity of the partial derivatives, $\partial_j f(p + h^{j-1}) - \partial_j f(p) = o(1)$ as $h \to 0.$ (Note that the term corresponding to $j = 1$ actually vanish, so we don't need continuity of $\partial_1 f.$) Whence,
$$
f(p + h) - f(p) - \sum_{j = 1}^d \partial_j f(p) \cdot h_j = \sum_{j = 1}^d o(1) h_j = o(h). \square
$$
Returning to your exercise... So, there you have it, if a function has continuous partial derivatives everywhere (as in your hypothesis), it is differentiable everywhere (and since the derivative as continuous entries, it is continuously differentiable everywhere).
