Let $(X,d)$ be a connected metric space and $(Y,d')$ is a compact metric space. Let $f$ be a continuous function from $(X\times Y,\max(d,d'))$ into $\mathbb{R}$. Because $Y$ is compact we can define:
$$g(x)=\inf_{y\in Y}f(x,y)$$
for all $x\in X$. I need to prove that $g$ is continuous.
First I tried to prove that if $(x_n)_{n\ge 0}\rightarrow a$ is a convergent sequences in $X$, $(g(x_n))_{n\ge 0}$ converges to $g(a)$. I arrived at showing that $(g(x_n))_{n\ge 0}$ has only one adherent value, which is $g(a)$, but no more.
Then I tried to use the fact that for fixed $x$, the function $f(x,y)$ is uniformly continuous in $y$, but there was not so much progress.
In either attempts, I never used the connectedness of $X$, so I think that's the key, but I don't know how to implement this.