Average of function, function of average I'm trying to find all functions $f : \mathbb{R} \to \mathbb{R}$ such that, for all $n > 1$ and all $x_1, x_2, \cdots, x_n \in \mathbb{R}$:
$$\frac{1}{n} \sum_{t = 1}^n f(x_t) = f \left ( \frac{1}{n} \sum_{t = 1}^n x_t \right )$$
My intuition is that this is only true if $f$ is a linear function. I started from the relation:
$$\sum_{t = 1}^n f(x_t) = f \left ( \sum_{t = 1}^n x_t \right )$$
That is, $f$ is additive. Then, by multiplying by $\frac{1}{n}$ each side, we obtain:
$$\frac{1}{n} \sum_{t = 1}^n f(x_t) = \frac{1}{n} f \left ( \sum_{t = 1}^n x_t \right )$$
And hence, any $f$ which has the property that $f(ax) = a f(x)$ (a linear function) will work. And since all linear functions are trivially additive, any linear function is a solution to my relation.

But all I have done is prove that linear functions are solutions, how should I go about showing that only linear equations are solutions? Is it valid to just "go backwards" in my argument, proving that if $f$ is a solution, then it must be linear? I feel it is not sufficient, since I only have implication and not equivalence. How do I proceed?
I think the $\frac{1}{n}$ term was added to confuse me, since without it, this would be straightforward.

What about function f that: 
$f(x+y)=f(x)+f(y)$    $\ \ \ \ \ \ x,y\in \mathbb{R}$
$f(a x)=af(x)$  $ \ \ \ \ \ a\in \mathbb{Q}, x\in \mathbb{R}$
This kind of function does not have to be continuous.
(It can be so wild that it does not have to be even measurable. And I guess(not sure at all) if it is measurable than it is linear function(in normal sense) almost everywhere.

Acording to wikipedia http://en.wikipedia.org/wiki/Harmonic_function#The_mean_value_property
All locally integrable continuous function that satisfy mean value property(in 1D it means $\frac{1}{2}(f(x)+f(y)) = f(\frac{x+y}{2})$) are infinitely differentiable and harmonics.
So I guess this answers your question.
