Suppose we have a map $f: S \rightarrow \mathbb{R}^{n}$, where $S \subset \mathbb{R}^{m}$, such that for each $a \in S$ there exists an $m$ by $n$ matrix $A$ such that
$\lim_{h \rightarrow 0}\frac{f(a+h)-f(a)-Ah}{|h|} = 0.$
What conditions must be satisfied so that $f$ can be extended to a differentiable function defined on an open set containing $S$? I know that if $f$ can be locally extended to a differentiable function, then $f$ can be extended in the desired way. However, is there a more general result...possibly an if and only if condition?