# How many elements can the set S(f)={f(x+y)−f(x)−f(y) | x,y∈R}S(f)=\{f(x+y)-f(x)-f(y)\ |\ x,y\in R\} have？

Question:

For a surjective function $f：\mathbb R\to \mathbb R$,where $\mathbb R$ denotes the set of real numbers, define the set

Assume that $S(f)$ is finite and $|S(f)|\neq 1$. Find the possible values of $|S(f)|$.

I think $|S(f)|=2$ is possible because of the example

It is clear $f$ is surjective,because for any $t\in R$, if we let $x=2t+2\{-2t\}$, then we have

and we then have

so we have

Using this method, Can we find examples such that $|S(f)|=3,4,5,\ldots$? Maybe there are other methods to solve this problem.

One example for more than 2.

$f(x) = \begin{cases} 1 &\text{if } x = \frac12 \\ 2 &\text{if } x = \frac14 \\ 4x &\text{if } x \neq \frac12, \frac14 \end{cases}$

$f(x) = 4x\operatorname{sgn}\left|x-\frac12\right|\operatorname{sgn}\left|x-\frac14\right| + 1(1 - \operatorname{sgn}\left|x-\frac12\right|) + 2(1 - \operatorname{sgn}\left|x-\frac12\right|)$
$S(f) = \{-3, -1, 0, 1, 2\}$

And the method to generate more of these functions with finite $|S(f)|$ values.

Given surjective real function $g: \mathbb{R} \to \mathbb{R}$, such that $\left|S(g)\right| = 1$, and a finite permutation on real numbers $h: \mathbb{R} \to \mathbb{R}$ with $n > 0$ values permuted, and the composition surjective real function $f(x) = g(h(x))$, the value $\left|S(f)\right|$ is finite, at least 2 and with the upper bound $1 + \frac12 n(n+5)$. (Working at the bottom)

Looking at your function and the other answer, I think the kinds of functions $F$ such that $S(F)$ is finite can be defined by composition of linear functions, finite permutations and surjective sawtooth functions.

$F = f_1 \circ \ldots \circ f_n$

where for each $i = 1, \ldots, n$, surjection is assumed and one of the following is true:

• $\exists m,c \in \mathbb{R} : m \neq 0 \land \forall x \in \mathbb{R} : f_i(x) = mx + c$ (linear)
• $\exists b \in \mathbb{R}_{>0} : \forall x \in \mathbb{R} : f_i(x) = x + (x {\%} b)$ (surjective sawtooth)
• $\left|\{x \in \mathbb{R} \mid f_i(x) \neq x \}\right| < \aleph_0 \land \forall y \in \mathbb{R}: \exists! x \in \mathbb{R}: f_i(x) = y$ (finite permutation)

Working out for the finite permutation case: