Question 35
Find all positive integers $n$ with the following property. Every function $f: \mathbf{R} \to \mathbf{R}$ such that
$$
f\left(\frac{a+b}{2}\right) = \frac{f(a)+f(b)}{2} \quad \text{for every } a, b \in \mathbf{R},
$$
satisfies also the condition
$$
f\left(\frac{x_1 + x_2 + \dots + x_n}{n}\right) = \frac{f(x_1) + f(x_2) + \dots + f(x_n)}{n}
$$
for every $x_1, x_2, \dots, x_n \in \mathbf{R}$.
$$
f\left(\frac{a+b}{2}\right) = \frac{f(a)+f(b)}{2} \quad \text{for every } a, b \in \mathbf{R},
$$
satisfies also the condition
$$
f\left(\frac{x_1 + x_2 + \dots + x_n}{n}\right) = \frac{f(x_1) + f(x_2) + \dots + f(x_n)}{n}
$$
for every $x_1, x_2, \dots, x_n \in \mathbf{R}$.