Let $X_i$ be i.i.d. random variables from a random sample of size $n$.
Find $f(x)$ such that
$$f(\bar X)=\frac{\sum_{i=1}^nX_i^2}{n}+\frac{\sum_{i=1}^nX_i}{n}$$
The second term is obvious (in other words, $f(x)=\text{???}+x$), but what function can I possibly define that will give me the first term? I don't see how I can decompose X bar like that in order to sum the squares. This has me very confused.