Problem

Source: St. Petersburg 2023 10.5

Tags: algebra



Let $x_0, x_1, \ldots, x_{n-1}, x_n=x_0$ be reals and let $f: \mathbb{R} \rightarrow \mathbb{R}$ be a function. The numbers $y_i$ for $i=0,1, \ldots, n-1$ are chosen such that $y_i$ is between $x_i$ and $x_{i+1}$. Prove that $\sum_{i=0}^{n-1}(x_{i+1}-x_i)f(y_i)$ can attain both positive and negative values, by varying the $y_i$.