Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ that satisfy the inequality  
$$ f(y)-\left(\frac{z-y}{z-x} f(x)+\frac{y-x}{z-x} f(z)\right) \leq f\left(\frac{x+z}{2}\right)-\frac{f(x)+f(z)}{2} $$  
for all real numbers $x<y<z$.
Answer: all functions of the form \( f(y) = a y^2 + b y + c \), where \( a, b, c \) are constants with \( a \leq 0 \). If \( I = (x, z) \) is an interval, we say that a real number \( \alpha \) is a supergradient of \( f \) at \( y \in I \) if we always have
\[ f(t) \leq f(y) + \alpha(t - y) \]
for every \( t \in I \). (This inequality may be familiar as the so-called "tangent line trick". A cartoon of this situation is drawn below for intuition.) We will also say \( \alpha \) is a supergradient of \( f \) at \( y \), without reference to the interval, if \( \alpha \) is a supergradient of some open interval containing \( y \). ![](https://cdn.mathpix.com/cropped/2024_11_19_9733e686be42a6dd888ag-7.jpg?height=375&width=984&top_left_y=1320&top_left_x=546)

Claim - The problem condition is equivalent to asserting that \( \frac{f(z) - f(x)}{z - x} \) is a supergradient of \( f \) at \( \frac{x + z}{2} \) for the interval \( (x, z) \), for every \( x < z \). Indeed by the problem condition,
\[ \begin{aligned} & f(y) \leq f(y - \varepsilon) + \frac{f(y + \varepsilon) - f(y - 3 \varepsilon)}{4} \\ & f(y) \leq f(y + \varepsilon) - \frac{f(y + 3 \varepsilon) - f(y - \varepsilon)}{4}. \end{aligned} \]
![](https://cdn.mathpix.com/cropped/2024_11_19_9733e686be42a6dd888ag-8.jpg?height=223&width=609&top_left_y=1699&top_left_x=1029)
Summing gives the desired conclusion. Now suppose that \( f \) has two supergradients \( \alpha < \alpha' \) at point \( y \). For small enough \( \varepsilon \), we should have \( f(y - \varepsilon) \leq f(y) - \alpha' \varepsilon \) and \( f(y + \varepsilon) \leq f(y) + \alpha \varepsilon \), hence
\[ g(\varepsilon) = \frac{f(y) - f(y - \varepsilon)}{\varepsilon} - \frac{f(y + \varepsilon) - f(y)}{\varepsilon} \geq \alpha' - \alpha. \]
This is impossible since \( g(\varepsilon) \) may be arbitrarily small.

Claim - The function \( f \) is quadratic on the rational numbers.
\[ f(x + 3d) - 3f(x + 2d) + 3f(x + d) - f(x) = 0. \]
If we fix \( d = 1/n \), it follows inductively that \( f \) agrees with a quadratic function \( \widetilde{f}_n \) on the set \( \frac{1}{n} \mathbb{Z} \). On the other hand, for any \( m \neq n \), we apparently have \( \widetilde{f}_n = \widetilde{f}_{mn} = \widetilde{f}_m \), so the quadratic functions on each "layer" are all equal.

Since \( f \) is continuous, it follows \( f \) is quadratic, as needed. Remark (Alternate finish using differentiability due to Michael Ren). In the proof of the main claim (about uniqueness of supergradients), we can actually notice the two terms \( \frac{f(y) - f(y - t)}{t} \) and \( \frac{f(y + t) - f(y)}{t} \) in the definition of \( g(t) \) are both monotonic (by concavity). Since we supplied a proof that \( \lim_{t \to 0} g(t) = 0 \), we find \( f \) is differentiable.

Now, if the derivative at some point exists, it must coincide with all the supergradients; (informally, this is why "tangent line trick" always has the slope as the derivative, and formally, we use the mean value theorem). In other words, we must have
\[ f(x + y) - f(x - y) = 2 f'(x) \cdot y \]
holds for all real numbers \( x \) and \( y \). By choosing \( y = 1 \) we obtain that \( f'(x) = f(x + 1) - f(x - 1) \) which means \( f' \) is also continuous.

Finally differentiating both sides with respect to \( y \) gives
\[ f'(x + y) - f'(x - y) = 2 f'(x) \]
which means \( f' \) obeys Jensen's functional equation. Since \( f' \) is continuous, this means \( f' \) is linear. Thus \( f \) is quadratic, as needed.