[proofplan]
We fix an arbitrary $y \in C$ and show $f(y) \geq f(x)$. The local minimality gives $f(x) \leq f((1-t)x + ty)$ for small $t > 0$, and the convexity of $f$ gives $f((1-t)x + ty) \leq (1-t)f(x) + tf(y)$. Chaining these two inequalities and dividing by $t > 0$ yields $f(x) \leq f(y)$.
[/proofplan]
[step:Apply the local minimality condition along the segment from $x$ to $y$]
Fix an arbitrary $y \in C$. Since $C$ is convex, the convex combination $(1-t)x + ty$ lies in $C$ for all $t \in [0,1]$. By the hypothesis that $x$ is a local minimum, there exists $t_0 > 0$ (which may depend on $y$) such that
\begin{align*}
f(x) \leq f\bigl((1-t)x + ty\bigr) \quad \text{for all } t \in (0, t_0).
\end{align*}
Fix any $t \in (0, \min\{t_0, 1\})$.
[/step]
[step:Apply convexity to bound $f\bigl((1-t)x + ty\bigr)$ from above]
Since $f$ is convex on $C$ and $(1-t) + t = 1$ with $t \in (0,1)$:
\begin{align*}
f\bigl((1-t)x + ty\bigr) \leq (1-t)f(x) + tf(y).
\end{align*}
[/step]
[step:Chain the two inequalities and divide by $t > 0$ to conclude]
Combining the results of the previous two steps:
\begin{align*}
f(x) \leq f\bigl((1-t)x + ty\bigr) \leq (1-t)f(x) + tf(y).
\end{align*}
Subtracting $(1-t)f(x)$ from both sides of the outer inequality:
\begin{align*}
f(x) - (1-t)f(x) \leq tf(y),
\end{align*}
which simplifies to $tf(x) \leq tf(y)$. Since $t > 0$, dividing both sides by $t$ gives
\begin{align*}
f(x) \leq f(y).
\end{align*}
Since $y \in C$ was arbitrary, $x$ is a global minimum of $f$ over $C$.
[guided]
The key insight is that convexity controls the function values along line segments: $f$ evaluated at the convex combination $(1-t)x + ty$ is bounded above by the convex combination of the endpoint values. The local minimality condition, on the other hand, gives a lower bound at the same point. Together, these create a "sandwich":
\begin{align*}
f(x) \leq f\bigl((1-t)x + ty\bigr) \leq (1-t)f(x) + tf(y).
\end{align*}
The left inequality uses local minimality (for small $t > 0$), and the right uses convexity. Rearranging: $f(x) - (1-t)f(x) = tf(x) \leq tf(y)$, so $f(x) \leq f(y)$.
Why does this argument not work for non-convex functions? Without convexity, we have no upper bound on $f((1-t)x + ty)$ in terms of $f(x)$ and $f(y)$, so local minimality alone tells us nothing about the value $f(y)$ at a distant point $y$.
[/guided]
[/step]