Let $K$ be a compact metric space and $f:K\times K\to \mathbb{R}$ a Lipschitz function. Is it true that the function $g:K\to \mathbb{R}$ defined by $g(x)=\max_{y\in K}f(x,y)$ is Lipschitz ?
Edit: What I tried was the following : define, for every $x\in K$, $h(x)$ to be any element of $K$ with $g(x)=f(x,h(x))$. Then \begin{align*} g(x_1)-g(x_2) &=f(x_1, h(x_1))-f(x_2, h(x_2))\\&\leq L\cdot( d(x,y)+d(h(x_1),h(x_2))) \end{align*} but we don't have any control on $h$.
Edit2: I think the answer is yes, from the inequalities $$f(x_1, h(x_1))-L\cdot d(x_1,x_2)\leq f(x_2,h(x_1))\leq f(x_2,h(x_2))$$ and $$f(x_2,h(x_2))-L\cdot d(x_1,x_2)\leq f(x_1, h(x_2))\leq f(x_1, h(x_1))$$ which show that $g$ is $L$-Lipschitz. Is this correct?