TITLE: Why does the concept of differentiation have the meaning only on open sets?
QUESTION [7 upvotes]: I am just stuck on the same problem asked in the following question. The book asks to implicitly differentiate two equations. Then it turns out the answer is "neither of them is implicitly differentiable". Alex M. in the previous question answers saying:

... $y = \pm x$ but this equality does not define on open set, only a finite set of points, and the concept of derivability makes no sense on such sets.

Can someone explain what is going on?

REPLY [4 votes]: Consider any subset $A \subset \mathbb{R}$ and any function $f : A \to \mathbb{R}$.
There is a useful definition of differentiability in this context, which can be formulated after the ordinary definition of differentiability has already been formulated, in which the domain is required to be open. Namely: $f$ is differentiable at a point $x \in A$ if there exists an open set $U \subset \mathbb{R}$ containing $x$, and there exists a function $\hat f : U \to \mathbb{R}$, such that $\hat f$ is differentiable at $x$, and such that $\hat f\mid _{ U \cap A} = f\mid_{ U \cap A}$.
For example, here's an exercise which relates this concept to the general concept of "one-sided derivatives": If $A = [a,b]$ is a closed interval then $f$ is differentiable at $a$ (according to the above definition) if and only if the following one sided derivative "from above" exists:
$$\lim_{h \to 0^+} \frac{f(a+h) - f(a)}{h}
$$
Similarly, $f$ is differentiable at $b$ if the one sided derivative at $b$ "from below" exists.
The exact same definition works if you allow $A$ to be a subset of a higher dimensional Euclidean space, and similarly let the target of $f$ be a higher dimensional Euclidean space. One context is which this concept is used is to define differentiable functions on objects like polygons or polyhedra (which leads to the general and very useful topic of "manifolds with corners").