If every composition of a differentiable path and a function is differentiable at 0, means the function is differentiable at 0 I'll write the question more formaly: Let $f :\mathbb{R^n} \rightarrow \mathbb{R}$ a certain function. Assume that for every differentiable path $p: [-1,1] \rightarrow \mathbb{R^n}$ so that $p(0) = 0 $ the composition $f(p(t))$ is differentiable at $t = 0$.  I need to prove that $f$ is differentiable at the zero vector. I came up with something, but i'm not sure if its correct, or too convoluted.
What I came up with, was to assume by contradiction that $f$ is not differentaible. So I just need to find a path which makes the composition $f(p(t))$ not diffferentiable. Because $f$ is not differentiable at 0, by definition for every liner map $A:\mathbb{R^n} \rightarrow \mathbb{R}$ the expression: $$g(x) = \frac{|f(x) - f(0) - <A(0),x>|}{||x||}\not\rightarrow 0$$ So by the limit definition there exists a sequence $x_n \rightarrow 0$ so that $g( x_n ) \not\rightarrow 0 $. Again by definition because of the convergence of $x_n$, For every $\epsilon > 0$ there is a $n_0 \in \mathbb{N}$ so for every $n > n_0$, $x_n \in B(0,\epsilon)$. Now if I take a path inside this ball, perhaps just a straight line inside this ball, it will be a differentiable path. If I compose it with $f$ I need to show that: $$h(t) = \frac{|f(p(t)) - f(0) - a*t|}{|t|}  \not\rightarrow 0$$ So I just need one sequence $t_n \rightarrow 0$ so that $h(t_n) \not\rightarrow 0$. I'm sort of unsure of the next step, $g(x)$ and $h(t)$ look quite similiar. I can fix a linear map $A$ so that for every $x \not= 0$, $<A(0),x> = a*t_n$ for every $a \in \mathbb{R}$. And then because for every $t_n$, $p(t_n) = x$ so that $x \in B(0,\epsilon)$,  $h(t_n)$ and $g(x_n)$ will behave the same way, therefore $h(t_n)$ wont converge to $0$.
This last part I'm having a hard time to explain formally, and also something seems wrong, but I can't quite figure out what. Any help will be greatly appreciated.
 A: The claim is false. In order to see this, we first make a few observations.
We can assume without loss of generality that $f\left(0\right)=0$.
Observation 1: Assume that $f$ is Lipschitz continuous and assume
that all directional derivatives
$$
f_{x}:=\lim_{t\to0}\frac{f\left(tx\right)-f\left(0\right)}{t}=\lim_{t\to0}\frac{f\left(tx\right)}{t}\text{ for }x\in\mathbb{R}^{n}
$$
exist. Then $f$ fulfills your assumption.
To see this, let $p:\left[-1,1\right]\to\mathbb{R}^{n}$ be a path
which is differentiable (in $0$) and satisfies $p\left(0\right)=0$.
Let $x:=p'\left(0\right)\in\mathbb{R}^{n}$. For $t\neq0$, we have
\begin{eqnarray*}
\left|\frac{f\left(p\left(t\right)\right)}{t}-f_{x}\right| & \leq & \frac{\left|f\left(p\left(t\right)\right)-f\left(tx\right)\right|+\left|f\left(tx\right)-tf_{x}\right|}{\left|t\right|}\\
 & \leq & \frac{L\cdot\left|p\left(t\right)-tx\right|}{\left|t\right|}+\left|\frac{f\left(tx\right)}{t}-f_{x}\right|\\
 & = & L\cdot\left|\frac{p\left(t\right)}{t}-x\right|+\left|\frac{f\left(tx\right)}{t}-f_{x}\right|\\
 & \xrightarrow[t\to0]{} & 0,
\end{eqnarray*}
where $L\geq0$ is a Lipschitz constant for $f$. Hence, $f\circ p$
is differentiable in $0$ with derivative $\frac{{\rm d}}{{\rm d}t}f\left(p\left(t\right)\right)=f_{x}=f_{p'\left(0\right)}$.
Observation 2: If $f:\mathbb{R}^{2}\to\mathbb{R}$ is Lipschitz continuous
with $f\left(0,y\right)=0$ for all $y\in\mathbb{R}$, then
$$
g:\mathbb{R}^{2}\to\mathbb{R},\left(x,y\right)\mapsto{\rm sgn}\left(x\right)\cdot f\left(x,y\right)
$$
is also Lipschitz continuous, where
$$
{\rm sgn}\left(x\right)=\begin{cases}
1, & \text{for }x\geq0,\\
-1 & \text{for }x<0.
\end{cases}
$$
Note that the value ${\rm sgn}\left(0\right)$ does not actually matter
because of $f\left(0,y\right)=0$ and hence $g\left(0,y\right)=0$
for any such choice.
To see that $g$ is Lipschitz, observe that for $\left(x,y\right),\left(a,b\right)\in\mathbb{R}^{2}$, we have
four cases:


*

*$x\geq0$ and $a\geq0$. In this case,
$$
\left|g\left(x,y\right)-g\left(a,b\right)\right|=\left|f\left(x,y\right)-f\left(a,b\right)\right|\leq L\cdot\left|\left(x,y\right)-\left(a,b\right)\right|.
$$

*$x<0$ and $a<0$. Here,
$$
\left|g\left(x,y\right)-g\left(a,b\right)\right|=\left|-f\left(x,y\right)+f\left(a,b\right)\right|\leq L\cdot\left|\left(x,y\right)-\left(a,b\right)\right|.
$$

*$a<0\leq x$. Here, we have
\begin{eqnarray*}
\left|g\left(x,y\right)-g\left(a,b\right)\right| & = & \left|f\left(x,y\right)+f\left(a,b\right)\right|\\
 & \leq & \left|f\left(x,y\right)-f\left(0,y\right)\right|+\left|f\left(0,b\right)-f\left(a,b\right)\right|\\
 & \leq & L\cdot\left[\left|x\right|+\left|a\right|\right]\\
 & = & L\cdot\left|x-a\right|\leq L\cdot\left|\left(x,y\right)-\left(a,b\right)\right|,
\end{eqnarray*}
where the last line used that $a<0\leq x$.

*$x<0\leq a$. Here, we can interchange $x,a$ and use case 3.


All in all, this shows that $g$ is indeed Lipschitz (with the same
Lipschitz constant as $f$).
Observation 3: The function
$$
f:\mathbb{R}^{2}\to\mathbb{R},\left(x,y\right)\mapsto\min\left\{ \left|x\right|,\left|y\right|\right\} 
$$
is Lipschitz continuous as a composition of Lipschitz continuous functions
and we have $f\left(0,y\right)=0=f\left(x,0\right)$ for all $x,y\in\mathbb{R}$.
By observation 2, the same is true of
$$
g:\mathbb{R}^{2}\to\mathbb{R},\left(x,y\right)\mapsto{\rm sgn}\left(x\right)\cdot\min\left\{ \left|x\right|,\left|y\right|\right\} .
$$
Observation 4: For the function $g$ above, all directional derivatives
exist. Indeed, we have for $\left(x,y\right)\in\mathbb{R}^{2}$ and
$t>0$:
\begin{eqnarray*}
\frac{g\left(t\cdot\left(x,y\right)\right)}{t} & = & \frac{{\rm sgn}\left(tx\right)\cdot\min\left\{ \left|tx\right|,\left|ty\right|\right\} }{t}\\
 & = & \frac{{\rm sgn}\left(x\right)\cdot\min\left\{ t\left|x\right|,t\left|y\right|\right\} }{t}\\
 & = & {\rm sgn}\left(x\right)\cdot\min\left\{ \left|x\right|,\left|y\right|\right\} =g\left(x,y\right).
\end{eqnarray*}
Similarly, for $t<0$:
\begin{eqnarray*}
\frac{g\left(t\cdot\left(x,y\right)\right)}{t} & = & \frac{{\rm sgn}\left(tx\right)\cdot\min\left\{ \left|tx\right|,\left|ty\right|\right\} }{t}\\
 & = & \begin{cases}
0=g\left(x,y\right), & \text{if }x=0,\\
\frac{-{\rm sgn}\left(x\right)\cdot\min\left\{ \left(-t\right)\left|x\right|,\left(-t\right)\left|y\right|\right\} }{t}, & \text{if }x\neq0
\end{cases}\\
 & \overset{-t>0}{=} & \begin{cases}
g\left(x,y\right), & \text{if }x=0,\\
{\rm sgn}\left(x\right)\cdot\min\left\{ \left|x\right|,\left|y\right|\right\} =g\left(x,y\right), & \text{if }x\neq0
\end{cases}\\
 & = & g\left(x,y\right).
\end{eqnarray*}
Hence, the directional derivatives are given by
$$
g_{\left(x,y\right)}=g\left(x,y\right).
$$
By observation 1, this implies that $g$ fulfils your assumptions.
Observation 5: $g$ is not totally differentiable/Frechet differentiable
at the origin, because we have
$$
g_{\left(1,0\right)}=g\left(1,0\right)=0\qquad\text{ and }\qquad g_{\left(0,1\right)}=g\left(0,1\right)=0,
$$
so that the Jacobi matrix of $g$ vanishes. If $g$ was totally differentiable,
we would have
$$
g\left(x,y\right)=g_{\left(x,y\right)}=x\cdot g_{\left(1,0\right)}+y\cdot g_{\left(0,1\right)}=0
$$
for all $x,y\in\mathbb{R}$, which is clearly false.
