Suppose that $A \subseteq \mathbb{R}^{n}$ is arbitrary, and $f :A \rightarrow \mathbb{R}$. Then $f$ is defined as smooth as long as for each point $x \in A$, there exists an open set $U$ of $\mathbb{R}^{n}$ containing $x$ and a smooth function $g:U\rightarrow\mathbb{R}$ which agrees with $f$ on $A$.
Now, I always assumed that the extending function did not matter, so that if $g$ and $g'$ are two smooth extensions as described above, then we are okay in just defining, for each component $i$, $$ \frac{\partial f}{\partial x_{i}}(x)=\frac{\partial g}{\partial x_{i}}(x)=\frac{\partial g'}{\partial x_{i}}(x) $$
After further thought, this obviously is not the case. Consider the set $A=\{0\}$, and define the function $f :A \rightarrow \mathbb{R}$ as $f(0)=0$. Then by definition, both $g(x)=x^{2}$ and $g'(x)=x$ are smooth extensions of $f$, which produce different derivatives at $x=0$.
What must we then have to ensure that the choice of extension does not matter? Do we need that the interior of $A$ be non-empty in order to exploit the continuity of derivatives?
Thanks in advance!
Having nonempty interior is not enough. For example, if $A\subseteq \mathbb R^2$ is the union of the closed left half-plane and the $x$-axis, then at points of the positive $x$-axis, the $y$-derivatives are not determined by the function's values on $A$.
What you need is for the set $A$ to be contained in the closure of its interior. If that's the case, then for each point $p\in A$, there is a sequence of points $p_i\in \operatorname{Int} A$ such that $p_i\to p$. If $f\colon A\to \mathbb R$ is a function and $g$ is any smooth extension of $f$ to a neighborhood of $p$, then any partial derivative $\frac{\partial g}{\partial x^j}(p)$ is equal to a limit of partial derivatives of $f$ at the points $p_i$, and thus is completely determined by $f$.