Continuity proof for compact domain

Solution 1:

You can't prove it, because it's not true. A two-dimensional counterexample: Let $f(x,w)=w$ on the cross-shaped set $\{(x,w): -2\le x,w\le 2\text{ and }\min(|x|,|w|)\le 1\}$. For this clearly continuous function, $$\max_w f(x,w)=\begin{cases}1&-2\le x< 1\\ 2&-1\le x\le 1\\ 1& 1<x\le 2\end{cases}$$ What additional conditions would we need to make this work? Convexity of the domain should do it.

Addendum: As seen in supinf's answer here, convexity isn't enough. I was hoping to avoid the overkill of making the domain a compact Cartesian product, but it looks like we can't do that.