In solving this question, I come across below result.
Let $(E, d)$ be a compact metric space and $f:E \to \mathbb R$ locally Lipschitz. Then $f$ is Lipschitz.
Could you have a check if my attempt is fine?
Because $f$ is locally Lipschitz, it is continuous. Let $M := \max_{x\in E} |f(x)|$. Suppose that $f$ is not Lipschitz on $E$.
- For each $n \in \mathbb N^*$, there exist $x_n, y_n \in E$ such that $2M \ge |f(x_n)-f(y_n)| > n d(x_n, y_n)$. It follows that $d(x_n, y_n) \to 0$.
- By compactness of $E$, we can assume $x_n \to a$ and $y_n \to a$ for some $a\in E$. Because $f$ is locally Lipschitz, there are $r,L>0$ such that $f$ is $L$-Lipschitz on the open ball $B(a,r)$.
- For $n$ large enough, we get $|f(x_n)-f(y_n)| \le Ld(x_n,y_n)$. It follows that $Ld(x_n,y_n)> n d(x_n, y_n)$ for $n$ large enough. This is a contradiction. This completes the proof.