On wikipedia, there is a counter-example for this statement. $f(x) = x^{3/2} \sin(\frac{1}{x})$ defined on $[0, 1]$ where $f(x) = 0$ is not Lipschitz since its derivative is not bounded.
Previously, I attempt to prove the wrong statement as follows and I am not sure where I was wrong in this.
wrong attempt: Proving all differentiable functions on a compact set $K \subset \mathbb{R}^n$ is Lipschitz
Suppose a differentiable function $f$ is not Lipschitz on $K \subset \mathbb{R}^n$. That is there exists two sequences $(x_k)_{k \in \mathbb{N}}, (y_k)_{k \in \mathbb{N}} \in K$ such that $$ ||f(y_k) - f(x_k)|| > k ||y_k - x_k|| $$ By Bolzano-Weierstrass theorem, the two sequences have convergent subsequences $(x_{k_n})_{n \in \mathbb{N}} \to x, (y_{k_n})_{n \in \mathbb{N}} \to y$.
If $x \neq y$ use the same argument in [1], there exists $N \in \mathbb{N}$ such that for all $n > N, ||y_{k_n} - x_{k_n}|| > ||y-x||/2$, therefore $$ ||f(y_{k_n}) - f(x_{k_n})|| > k_n||y_{k_n} - x_{k_n}|| > k_n ||y - x|| / 2 $$ That is $f(K)$ is unbounded. Contradiction
If $x = y$, as $f$ is differentiable at $x$, for all $\epsilon > 0$, there exists $\delta > 0$ such that for all $z \in B_\delta(x), ||f(z) - f(x) - L(z - x)||$ where $L = f'(x)$ with its norm $||L||$ being finite. Furthermore, $(x_{k_n})_{n \in \mathbb{N}} \to x, (y_{k_n})_{n \in \mathbb{N}} \to x$ implies that, there exists $N \in \mathbb{N}$ such that $x_{k_n}, y_{k_n} \in B_\delta(x), x_{k_n} \neq y_{k_n}$ for all $n > N$. We can bound the difference between $f(y_{k_n})$ and $f(x_{k_n})$ by
\begin{align*} ||f(x_{k_n}) - f(y_{k_n}) - L(y_{k_n} - x_{k_n}) || &= ||[f(x_{k_n}) - f(x) - L(x_{k_n} - x)] - [f(y_{k_n}) - f(x) - L(y_{k_n} - x)] || \\ &\leq ||f(x_{k_n}) - f(x) - L(x_{k_n} - x)||+ ||f(y_{k_n}) - f(x) - L(y_{k_n} - x)|| \\ &< 2\epsilon \end{align*}
So, $$ 2 \epsilon > ||f(x_{k_n}) - f(y_{k_n})|| - ||L(y_{k_n} - x_{k_n}) || \geq ||f(x_{k_n}) - f(y_{k_n})|| - ||L||.||y_{k_n} - x_{k_n} || $$ Combine with the premise, $$ 2\epsilon > (k_n - ||L||) ||y_{k_n} - x_{k_n}|| $$ Choosing $n$ large enough yields a contradiction