Find function such that $\sum y_i\le\sum x_i\Rightarrow\sum f(y_i)\le\sum f(x_i)$ What kind of a function $f$ must be to satisfy the following?
If $\sum_{i=1}^{n} y_i \leq \sum_{j=1}^{n} x_j$, where $x_j, y_i \in [0,1],\forall i,j$ then $$ \sum_{i=1}^{n} f(y_i) \leq \sum_{j=1}^{n} f(x_j).$$
Any help would be appreciated. Thanks in advance!
Preferably $f$ must be convex and increasing.
$f$ is linear from the answer given by the user grand_chat. What if the above inequalities($\leq$) are replaced by the strict inequality ($<$)?
 A: The only solutions are linear, i.e. $f(x) = cx + b$.
Wlog we can assume $f(0)=0$ by considering $g(x):=f(x)-f(0)$. Also, $f$ is nondecreasing; this follows from applying the stated property with $n=1$.
Taking $x_1+x_2 = y_1+y_2$ and applying the stated property twice (in both directions of inequality) we obtain:
$$f(y_1)+f(y_2) = f(x_1) + f(x_2)\qquad\text{whenever $y_1+y_2=x_1+x_2$.}\tag1
$$
Finally note that $(x+y) + 0 = x + y$ so (1) gives
$$f(x+y) = f(x) + f(y).\tag2$$
Equation (2) is the famous Cauchy functional equation. Property (2) along with the monotonicity of $f$ implies that $f(x)=cx$ for some  $c\ge0$ (since $f$ is nondecreasing).

EDIT: If we relax the inequality $(\le)$ to a strict inequality $(<)$, the same result follows except we rule out the possibility $c=0$. This follows from a continuity argument:


*

*First show that (2) holds whenever $y$ is a continuity point for $f$, by considering $$x+(y-\epsilon) < (x+y) + 0 < x + (y+\epsilon).$$

*$f$ is monotone, so has only countably many discontinuities. Let $x_0$ be a continuity point for $f$, and let $\{ y_n \}$ be a sequence of continuity points tending to $0$. We have for all $n$
$$
f(y_n) = f(x_0+y_n) - f(x_0).
$$
Since $f$ is continuous at $x_0$, we have $\lim f(y_n)=0$. Monotonicity of $f$ forces $f$ to be continuous at zero.

*Lastly, let $x$ be arbitrary and let $\{ y_n\}$ be a sequence of continuity points tending to zero. Letting $n\to\infty$ in the identity
$$
f(x+y_n)=f(x) + f(y_n)
$$
shows that $f$ is continuous at $x$. Hence every point is a continuity point for $f$, and therefore (2) holds everywhere.
