Before going to my question, let me give two prelimilary definitions
Definition 1. Let $S\subseteq\mathbb{R}^n$ be a non=empty open set in $\mathbb{R}^n$ under the usual topology on $\mathbb{R}^n$ and $f:S\to \mathbb{R}^m$. Let $\mathbf{c}\in S$ and $g:U(\subseteq \mathbb{R})\to S$ is such that,
$U$ is open in $\mathbb{R}$ under the usual topology on $\mathbb{R}$
$g(0)=\mathbf{c}$
$g$ is continuous at $0$
Then $f$ will be said to have derivative along the cruve $g$ at the point $\mathbf{c}$ if, $$\displaystyle\lim_{h\to 0}\dfrac{(f\circ g)(h)-(f\circ g)(0)}{h}$$ exists.
Definition 2. Let $S\subseteq\mathbb{R}^n$ be a non=empty open set in $\mathbb{R}^n$ under the usual topology on $\mathbb{R}^n$ and $f:S\to \mathbb{R}^m$. Let $\mathbf{c}\in S$. Then $f$ will be said to have approach independent derivative at $\mathbf{c}$ if, $$\displaystyle\lim_{h\to 0}\dfrac{(f\circ g)(h)-(f\circ g)(0)}{h}$$ exists for all $g$ satisfying the properties listed in the previous definition.
Question
If $f$ has approach independent derivative at $\bf{c}$ then is it continuous at $\mathbf{c}$?
I was trying to find a counter example of such a function $f$ but till now I have not been able to find such an example. Any help will be appreciated.
If $f$ has an approach independent derivative at $c$, then $f$ is constant in a neighborhood of $c$ (and therefore rather trivially is continuous at $c$).
Indeed, suppose $f$ is not constant in any neighborhood of $c$. That means there is a sequence $(c_n)$ approaching $c$ such that $f(c_n)\neq f(c)$ for all $n$.
Now choose a descending sequence of real numbers $t_n$ approaching $0$ such that $0<t_n<|f(c)-f(c_n)|/n$ for all $n$. Define $g:(-1,t_1)\to \mathbb{R}^n$ by $g(t)=c$ if $t\leq 0$, $g(t_n)=c_n$, and $g$ interpolates linearly on each interval $(t_{n+1},t_n)$. This is obviously continuous everywhere except possibly at $0$; continuity at $0$ follows from the fact that $c_n$ converges to $c$. Letting $U=g^{-1}(S)$, we can restrict $g$ to $U$ and it will satisfy all of your conditions.
However, observe that for each $n$, $$\frac{(f\circ g)(t_n)-(f\circ g)(0)}{t_n}=\frac{f(c_n)-f(c)}{t_n}$$ has absolute value greater than $n$ by our choice of $t_n$. Since $t_n\to 0$ as $n\to\infty$, this proves that the derivative of $f$ along $g$ at $c$ does not exist.
Note that this conclusion should not be surprising. You are asking for $f\circ g$ to be differentiable at $0$. But you only assume that $g$ is continuous, so it is totally unreasonable to expect $f\circ g$ to be differentiable, even if $f$ is differentiable. For instance, the identity function $f:\mathbb{R}\to\mathbb{R}$ trivially fails to satisfy your property, since you could take $g$ to be any function that is continuous but not differentiable at $0$. For $f$ to have your property, it must somehow be "extremely differentiable" (at least along curves) such that its differentiability is preserved by composing it with any continuous (not necessarily differentiable!) function. It turns out that the only way this can happen is if $f$ is constant (at least locally).