# Continuity of Lipschitz constant with respect to Hausdorff metric

I was thinking about Lipschitz constants and their dependence on the domain. This led me to the following question:

Let $f$ a function that is Lipschitz continuous over the domain $A\subset\mathbb{R}^{n}$ be given. Suppose $K(A)$ is the set of compact subsets of $A$. This has a topology induced by the Hausdorff metric (See here for the definition).

Let $L_{f}(B)\colon K(A)\to\mathbb{R}$ be the (best) Lipschitz constant for $f$ on the compact set $B\in K(A)$. Is this continous with respect to the standard topology of euclidean space and the Hausdorff metric topology of $K(A)$?

I suspect the answer is probably not. A function with a sufficient discontinuous derivative should break things, but I'm having trouble engineering an example.

I'm also wondering when it might be true? For $C^{\infty}$ functions? For polynomials? Maybe this is true for a certain class of bounds for $L_{f}$ (e.g bounds on the gradient) for a given class of functions $f$ (e.g $C^{1}$ functions)?

Another thought: What is the relation between $L_{f}$ and the idea of a local Lipschitz function?

For an easy counterexample to continuity of $L_f(B)$, take $$f(x) = \begin{cases} x \,\text{if x \ge 0} \\ 2x \,\text{if x \le 0} \end{cases}$$ So $L_f[0,1]=1$ and $L_f[-\epsilon,1]=2$ for all $\epsilon > 0$, whereas the Hausdorff distance between $[0,1]$ and $[-\epsilon,1]$ equals $\epsilon$.