By Wikipedia's definition, a mapping $f:X\mapsto Y$ ($X,Y$ are metric spaces) is locally Lipschitz if for every $x\in X$ there exists a neighborhood $U$ of $x$ such that $f$ restricted to $U$ is Lipschitz. It further claims that if $X$ is locally compact, then $f$ is locally Lipschitz $\Leftrightarrow$ $f$ is Lipschitz on every compact subset of $X$.
I understand that $\Leftarrow$ is clear, but I'm not sure why is $\Rightarrow$ true. For example, what if the compact subset $K$ is not path-connected?