Total derivative only defined on open subset Let's say that $f: M \to\mathbb{R}^n$, where $M \subset \mathbb{R}^m$, is totally differentiable at point $a$ so that we have an open subeset $U$ with $a \in U \subset M$. 
Why does $U$ have to be an open set? What's wrong with it if you assume that $U$ is closed and $a$ lies on the edge of subset $U$?
edit
Why is it not sufficient to assume that $a$ is a limit point if you want to show the uniqueness of the total derivative?
 A: The issue if you do so is that you may lose the unicity of the (Fréchet) derivative.
To see it consider a map $f$ defined on a line $M \subseteq \mathbb R^2$ onto $\mathbb R$. You won’t be able to find a unique linear map of two variables that represents the derivative.
To figure it, just look at a constant map.
A: $\newcommand{\R}{\mathbb{R}}$
Let's simplify the above example even further, take $M = \{ (x,y) \in \R^2 \mid x\in \R, y= 0\}$. And take $0 = F : M \to \R$ and investigate the differentiability from $F$ at $0$. Now, the point is, that you can not take any $h \in \R^2$ when looking at the difference quotient but only those for which $0+h = h \in M$ (see below), that is necessarily $h = (h_1,0)$. Hence take $A = (0,\lambda)$ with $\lambda \in \R$ then we get
$$
\lim_{h \to 0} \frac{\|f(0+h) - f(0) -(0,\lambda)^T \cdot(h_1,0)\|}{\|h\|} = 0.
$$ 
Here some further thoughts and discussions:
First let's observe, that the usual definition of when we call a linear map a differential is quite problematic for any closed set. Take for example a single point. Thats why in 1d one usually requires a non trivial (not just one point or empty) but otherwise arbitrary interval. So one has at least "enough" points. 
With that one could agree that we should at least have a closed set $M$ in $\R^m$ (or even arbitrary set) but with the property that for any point $p$ in $M$, there is an open set $U$ in $\R^m$ with $p$ in it, such that $M\cap U$ has not an empty interior.  

The "usual" definition reads: Let $M \subset \R^m$ open, $p \in M$, then a function $f : M \to \R^n$ is called differentiable in $p$ if there is a linear map $A : \R^m \to \R^n$ such that for all $p+h$ that are contained in an (open) neighborhood $U \subset M$ of $p$ holds:
  $$
f(p+h) - f(p) = Ah + r(h) \qquad \text{where} \quad \lim_{h \to 0} \frac{r(h)}{\|h\|} = 0 ,\quad  r : 0\in dom(r)\subset \R^m \to \R^n.
$$

Now, consider $K := \overline {M}$ (which is general enough, I guess), $f : K \to \R^n$ and take $p$ to be on the boundary (e.g. $p \in \partial M$), then the above definition does not make sense anymore, since there is no such neighborhood $U$. But lets try to fix it, by just requiring that the above is true for a neighborhood $U \subset \R^m$ of $p$ and for all $p+h$ that are contained in $U \cap K$. 
So far so good. Now what does $\lim_{h\to 0}$ mean now? It still means sending $h \in \R^m$ to $0 \in \R^m$ but now we only can take those sequences that are in the set $\{h \in \R^m : p+h \in U\cap K,\, h \neq 0\}$. I don't think that there is anything wrong with this approach and you can compare it with this interesting discussion. But as shown above you might loose uniqueness and (many) other properties.
Extension
Let me also mention a different approach, that actually is in use (in contrast to the above?!):

Let $K \subset \R^m$ be an arbitrary (!) set, then $f : K \to R^n$ is called differentiable at $p \in K$, if there exists an open set $U \in \R^m$ that contains $p$ and a in $p$ differentiable function $\tilde F : U \to \R^n$ such that $\tilde F\big|_{U \cap K} = F$. 

You can find it in Lee's Introduction to smooth manifolds on page 645.
Thank you for this question. I learned a lot! 
