My analysis textbook has this definition: Theorem 1: Let A be an open set in $ℝ^n$ and suppose $f :A \to R^m$ is differentiable at $x_0$. Then $Df(x_0)$ is uniquely determined by $f$.
Why won't this definition hold for a closed set? Can't we have that $Df(x_0)$ is uniquely determined by $f$ on a closed set? For example why won't $A$ a closed set in $ℝ^2$ allow us to have $Df(x_0)$ is uniquely determined by $f$. This is an example I am looking at:
$A := [{(x,y) ∈ ℝ^2|0 ≤ x ≤ 1,y = 0}]$
If you look here (curiously, a question also asked by you), it will be clear why openness makes the derivative unique.
Uniqueness can't hold for a function defined on an arbitrary closed set. Take $A$ to be a single point, say. It should be clear why uniqueness can't hold.
If the closed set is such that there exists a neighbourhood $V$ of $x_0$ in the induced topology such that $V$ is a star set (with "star point" $x_0$) and $\mathrm{span}\langle-x_0+V\rangle=\mathbb{R}^n$, then the derivative is unique (actually, being closed is irrelevant). This is due to the fact that we can repeat the computations done in the answer linked above and conclude that the linear map is determined on all elements of $-x_0+V$. Since the set where two linear maps coincide is a vector space and we've just concluded that they coincide on $-x_0+V$, then they coincide in their span, making both of them equal since that span is the whole $\mathbb{R}^n$.
This is useful for instance to prove that derivatives on the half-space $\mathbb{H}^n$ are well-defined on the boundary, since $\mathbb{H}^n$ satisfies the geometrical hypothesis above.
Your example does not satisfy such geometrical property (note that the span will be $\mathbb{R}$), and in fact the derivative would not be unique. You can put literally any assignment to the vector $e_2$ and keep $Te_1=\partial_1f$ and this would be "another" derivative.