Characterization of real-valued linear functions in $R^n$ From this post:
Characterization of linear functions in $\mathbb{R}$ using distance
I learn that a function $f:R\rightarrow R$ is linear
if and only if there exists $k\in R$ such that $|\frac{f(a)-f(b)}{a-b}|=k$ for all $a\neq b\in R$.
I want to ask if it is still true when $f$ is defined on $R^n$?
That is, $f:R^n\rightarrow R$ is linear
if and only if there exists $k\in R$ such that $\frac{|f(a)-f(b)|}{||a-b||}=k$ for all $a\neq b\in R^n$, where $||\cdot||$ is the Euclidean norm.
If not, is there a similar characterization of linear functions in $R^n$?
 A: No. 
The function $f(x)=x_1$ (first coordinate) is a linear functional on $\mathbb{R}^n$, and it is not true that $|x_1-y_1|$ is proportional to the distance between $x$ and $y$ for every $x,y\in\mathbb{R}^n$. For instance, it can be zero, and it can be non-zero.
Linear functionals on $\mathbb{R}^n$ are characterized as follows:
$f:\mathbb{R}^n\to\mathbb{R}$ is a linear functional if and only if there exists a vector $a\in\mathbb{R}^n$ such that for every $x\in\mathbb{R}^n$,
$$f(x)=a_1x_1+\cdots +a_nx_n$$
A: This is not true. Let $f: \mathbb{R}^2 \to \mathbb{R}$ be defined by $f(x,y) = -x-y$.
Then for $a = (0,0), b=(-1,1)$: $$\frac{|f(a)-f(b)|}{||a-b||} = 0. $$
But for $a = (0,0), b = (1,1)$: $$\frac{|f(a)-f(b)|}{||a-b||} = \frac{|0-(-2)|}{||(-1,1)||} = \frac{2}{\sqrt{2}}.$$

Note that we can "graph" this function in $\mathbb{R}^3$ with the $z$-axis corresponding to $f(x,y)$. The graph is then the plane $x + y + z = 0$. Let $a = (a_1, a_2), b = (b_1,b_2)$. If we are standing at the point $(a_1,a_2,f(a_1,a_2))$ on this plane, the quantity $\frac{|f(a)-f(b)|}{||a-b||}$ describes how much our altitude changes per distance traveled in the direction of $(b_1,b_2,f(b_1,b_2))$. I.e. we have some measure of "slope" in that direction. Note that because we took absolute values, this steepness will be positive even though we may be walking downward to get to $(b_1,b_2,f(b_1,b_2))$.
From this observation you can see that this quantity $\frac{|f(a)-f(b)|}{||a-b||}$ will not be a constant except for under very special circumstances. If your plane is tilted at all, there will be different steepness in different directions.
