Differentiability of $f : \mathbb{R} \rightarrow C$ where $C$ is a finite set I'm having a confusion with the definition of differentiable: is it true that we only define 'differentiable' for functions which have as domain and co-domain (a subset of) the real numbers? I.e., can I say the following: 

Let $f$ be a fuction $\mathbb{R} \rightarrow C$ where $C$ is some finite set with $|C| > 1$ and $\forall c \in C \ \exists x \in \mathbb{R}$ s.t. $f(x) = c$. Such a mapping $f$ can not be differentiable.

Or how would you express the notion that it is not possible to think of differentiable when talking about such functions?
 A: If $f$ is differentiable it is continuous, therefore it maps the connected set $\Bbb R$ to another connected set. Since $|C|>1$, the image is disconnected a contradiction to the assumption of continuity. If you are not familiar with the term "connected" yet, just use the intermediate value theorem. Choose $x,y\in C$ so that $x<y$ and there is no $z\in C$ such that $x<z<y$, i.e. they are adjacent. Then since $f$ does not take on every value between $x$ and $y$ it does not satisfy the intermediate value theorem, in particular it is not continuous.
A: Since $C$ is finite, there are some $c_{1},\dots, c_{n} \in \mathbb{R}$ (here $\mathbb{R}$ can be replaced with a metric space in general) such that $C = \{ c_{1}, \dots, c_{n} \}$. Then $d := \min_{1 \leq i \neq j \leq n} |c_{i}-c_{j}| > 0$. Now for every $x \in \mathbb{R}$, there is some $\varepsilon > 0$, say $\varepsilon := d/2$, such that for every $\delta > 0$ and every $x' \neq x$ we have $|f(x')-f(x)| = |c_{i}-c_{j}| \geq d > \varepsilon$ for some $1 \leq i \neq j \leq n$. So $f$ is not continuous and hence not differentiable. 
Note that $|f(x) - f(x')| = \frac{|f(x)-f(x')|}{|x-x'|}\cdot |x-x'|$ for all $x \neq x'$; so differentiablity implies continuity.
