M. Spivak in Calculus on Manifolds defined differentiability as:
$f:\mathbb R^n\to\mathbb R^m$ is differentiable at $a\in\mathbb R^n$ if there exists a linear transformation $\lambda:\mathbb R^n\to\mathbb R^m$ such that $$\lim_{h\to0}\dfrac{|f(a+h)-f(a)-\lambda(h)|}{|h|}=0$$
$\lambda$ is denoted by $Df(a)$ which is called the derivative of $f$ at $a.$
He made the following remark regarding the above definition:The definition of $Df(a)$ could be made if $f$ were defined only in some open set containing $a.$
Here is the problem I am facing. Why the domain of $f$ needs to be open for the definition to work?