How to prove whether a function is linear or affine? so i am having hard time understanding the idea of coming up with random n-vectors to disprove the superposition equality $f(\alpha x + \beta y) = \alpha f(x) + \beta f(y)$.
or to prove that a function is linear or affine???
can someone explain to me for the following function examples?


*

*$f(x) = \min x_i$

*$f(x) = \sum_{i=1}^n|x_i|$

*$f(x) = \sum_{i=1}^n|x_{i + 1} - x_i|$

 A: *

*$\displaystyle f(x)=\min_{i=\overline{1,n}}x_i$ is neither linear nor affine. Indeed,
let $x=(-1,1, 0, \ldots, 0), y=(1,-1, 0, \ldots, 0)\in \mathbb{R}^n$ we have
$$
f(x)+f(y)=-1-1=-2\ne 0 = f(x+y),
$$
$$
\frac{1}{2}f(x)+\frac{1}{2}f(y)=-\frac{1}{2}-\frac{1}{2}=-1\ne 0 = f[(1/2)x+(1/2)y].
$$

*$\displaystyle f(x)=\sum_{i=1}^{n}|x_i|$ is neither linear nor affine. Indeed, let $x=(-1,1, 0, \ldots, 0), y=(1,-1, 0, \ldots, 0)\in \mathbb{R}^n$ we have
$$
f(x)+f(y)=2+2=4\ne 0 = f(x+y),
$$
$$
\frac{1}{2}f(x)+\frac{1}{2}f(y)=1+1=2\ne 0 = f[(1/2)x+(1/2)y].
$$

*$\displaystyle f(x)=\sum_{i=1}^{n}|x_{i+1}-x_i|$ can not be defined since we do not have $x_{n+1}$ in the expression of $x$.

A: To prove that $f:\mathbb{R}^n\rightarrow \mathbb{R}$ is not a linear function we only need to choose two points $x,y\in\mathbb{R}^n$ such that
$$
f(x+y)\ne f(x)+f(y)
$$
or
$$
f(\lambda x)\ne \lambda f(x)
$$
for some $\lambda$.
To prove that $f:\mathbb{R}^n\rightarrow \mathbb{R}$ is not an affine function we only need to  choose two points $x, y\in\mathbb{R}^n$ and $\alpha\in \mathbb{R}$ such that
$$
f[\alpha x+ (1-\alpha)y]\ne \alpha f(x)+ (1-\alpha)f(y).
$$
