If every composition of a differentiable path and a function is differentiable at 0, means the function is differentiable at 0

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:

  1. $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|. $$

  2. $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|. $$

  3. $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$.

  4. $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.