Continuity of the locus of the maximum of a two variables real function Suppose that $$\begin{array}{lrcl}
f : & [0,1]^2 & \longrightarrow & \mathbb{R} \\
    & (x,y) & \longmapsto & f(x,y) \end{array}$$ is a continuous function and that for all $x \in [0,1]$ $$\max_{y \in [0,1]} f(x,y)$$ is reached at a unique point $g(x)$, i.e. $$\max_{y \in [0,1]} f(x,y)=f(x,g(x))$$
What can we say about $g$ continuity?
Note: the question here is related but different.
 A: $g$ is indeed continuous (and the condition that for each $x$ the maximum
of $ f(x,y)$ is attained at a unique point $y$ is essential).
Let $g(x_0) = y_0$, i.e. $M := f(x_0, y_0) = \max_{y \in [0,1]} f(x_0,y$),
and let $\varepsilon > 0$.
$f(x_0, y)$  is strictly less than $M$ for $|y - y_0| \ge \varepsilon$
(because of the uniqueness condition). Since $f$ is continuous,
we can choose $a$, $b$, $c$ such that
$$
 f(x_0, y) \le a < b < c < M \text{ for } |y - y_0| \ge \varepsilon \, .
$$
Now the uniform continuity implies that there is a $\delta > 0$
such that
$$ \tag 1
 f(x, y) \le  b 
\text{ for } |x - x_0| < \delta, |y - y_0| \ge \varepsilon \, .
$$
On the other hand, the continuity of $f$ at $(x_0, y_0)$ implies
that there is a positive $\delta_1 < \delta$ such that
$$ \tag 2
 f(x, y_0) > c \text{ for }  |x - x_0| < \delta_1 \, .
$$
Now let $|x - x_0| < \delta_1$. From $(2)$ we see that the maximum
of $y \to f(x, y)$ is at least $c$, and from $(1)$ we see that
this maximum can not be attained for $|y - y_0| \ge \varepsilon$.
It follows that the maximum is attained for some $y$
with  $|y - y_0| < \varepsilon$.
In other words, 
$$
|g(x) - y_0| < \varepsilon  \text{ for }  |x - x_0| < \delta_1 \, .
$$
