$C^1$ function on compact set is Lipschitz

The convexity of $K$ is not needed. Suppose the conclusion fails. Then for each $m\in \mathbb N,$ there exist $y_m,x_m \in K$ such that

$$\tag 1 |f(y_m)- f(x_m)| > m|y_m-x_m|.$$

Because $K$ is compact, we can find a subsequence $m_k$ such that the sequences $y_{m_k},x_{m_k}$ converge to points $y,x\in K$ respectively.

Suppose $y\ne x.$ Then $|y-x| > 0.$ For large $k$ we then have

$$|f(y_{m_k})- f(x_{m_k})| > m_k|y_{m_k}-x_{m_k}|> m_k(|y-x|/2)\to \infty$$

This implies $f$ is not bounded on $K.$ But $f$ is continuous on $A,$ hence is continuous on $K,$ hence $f$ is bounded on $K$ by compactness. This contradiction shows $y=x.$

Because $A$ is open we can choose $r>0$ such that $B(x,r)\subset A.$ For large $k$ we then have $y_{m_k},x_{m_k}$ in the compact convex set $\overline {B(x,r/2}) \subset A.$ By $(1),$ your highlighted mean value inequality then fails in this last set, contradiction. Therefore $(1)$ cannot hold, proving the result.


Here's how I would do it:

for $x, y \in K$, let $\gamma(t):[0, 1] \to K$ be the line segment

$\gamma(t) = x + t(y - x); \tag{1}$

then

$\gamma(0) = x, \tag{2}$

$\gamma(1) = x +(y - x) = y, \tag{3}$

and

$\gamma'(t) = y - x; \tag{4}$

furthermore, since $K$ is convex, $\gamma(t)$ lies entirely within $K$, hence also in $A$.

Now, for $x, y \in K$, we have:

$\Vert f(y) - f(x) \Vert = \Vert \displaystyle \int_0^1 \dfrac{d(f(\gamma(t))}{dt}dt \Vert = \Vert \displaystyle \int_0^1 \nabla f(\gamma(t)) \cdot \gamma'(t) dt \Vert$ $\le \displaystyle \int_0^1 \Vert \nabla f(\gamma(t)) \cdot \gamma'(t) \Vert dt \le \displaystyle \int_0^1 \Vert \nabla f(\gamma(t)) \Vert \Vert \gamma'(t) \Vert dt.\tag{5}$

Since $K$ is compact and $\nabla f \in C^0(A, \Bbb R)$, so hence $\nabla f \in C^0(K, \Bbb R)$, $\Vert \nabla f \Vert$ is bounded by some $B$ on $K$, hence

$\displaystyle \int_0^1 \Vert \nabla f(\gamma(t)) \Vert \Vert \gamma'(t) \Vert dt \le \displaystyle \int_0^1 B \Vert \gamma'(t) \Vert dt; \tag{6}$

using (4),

$\displaystyle \int_0^1 B \Vert \gamma'(t) \Vert dt = \displaystyle \int_0^1 B \Vert y - x \Vert dt = B \Vert y - x \Vert; \tag{7}$

bringing together (5), (6), and (7) yields

$\Vert f(y) - f(x) \Vert \le B \Vert y - x \Vert, \tag{8}$

that is, $f(x)$ is Lipschitz continuous on $K$.