Let $X, Y$ be topological spaces, and $Y$ is compact, and let $f: X \times Y \rightarrow \mathbb{R}$ be a continuous function. Define $g: X \rightarrow \mathbb{R}$ as $g(x) = \inf_{y \in Y} f(x,y)$. Is $g$ continuous? I think the answer is yes, but can someone provide a simple proof?
Does it hold if $Y$ is non-compact?
For general, not necessarily compact $Y$, this map is upper-semicontinuous, but not necessarily lower-semicontinuous. When $Y$ is compact, then we get full continuity.
Fix $x_0 \in X$, let $\alpha = g(x_0)$, and suppose $\varepsilon > 0$. The set $f^{-1}(-\infty, \alpha + \varepsilon)$ must contain points in $\{x_0\} \times Y$, otherwise $\alpha = \inf_{y \in Y} f(x_0, y) \ge \alpha + \varepsilon$, which is impossible. Pick any $(x_0, y_0) \in f^{-1}(-\infty, \alpha + \varepsilon)$, and let $\mathcal{U} \times \mathcal{V}$ be a basic open neighbourhood of $(x_0, y_0)$ contained in $f^{-1}(-\infty, \alpha + \varepsilon)$. Then, $$x \in \mathcal{U} \implies g(x) = \inf_{y \in Y} f(x, y) \le \inf_{y \in \mathcal{V}} f(x, y) < \alpha + \varepsilon.$$ That is, $g$ is upper-semicontinuous.
Suppose now that $Y$ is compact. Again, fix $x_0 \in X$, let $\alpha = g(x_0)$, and suppose $\varepsilon > 0$. The set $f^{-1}(\alpha - \varepsilon, \infty)$ is open in $X \times Y$ by the continuity of $f$, and this set must contain $\{x_0\} \times Y$.
For each $(x_0, y) \in \{x_0\} \times Y \subseteq f^{-1}(\alpha - \varepsilon, \infty)$, we can find a basic open neighbourhood $\mathcal{U}_y \times \mathcal{V}_y$ of $(x_0, y_0)$ that is contained in $f^{-1}(\alpha - \varepsilon, \infty)$, and these form an open cover of $\{x_0\} \times Y$.
By the compactness of $Y$ there exist $y_1, \ldots, y_n \in Y$ such that $$\{x_0\} \times Y \subseteq \bigcup_{i=1}^n \left(\mathcal{U}_{y_1} \times \mathcal{V}_{y_n}\right) \subseteq f^{-1}(\alpha - \varepsilon, \infty).$$ Let $\mathcal{U} = \bigcap_i \mathcal{U}_{y_i}$. Then $$\{x_0\} \times Y \subseteq \mathcal{U} \times Y \subseteq f^{-1}(\alpha - \varepsilon, \infty).$$ That is, for every $y \in Y$ and $x \in \mathcal{U}$, $f(x, y) > \alpha - \varepsilon$, hence taking the infimum over $y \in Y$, $$x \in \mathcal{U} \implies g(x) = \inf_{y \in Y} f(x, y) \ge \alpha - \varepsilon.$$ Thus, when $Y$ is compact, we have lower-semicontinuity as well.
Finally, let's finish with an example to show sharpness. Due primarily to laziness, I'm going to let $X = Y = \Bbb{R}$, and use Urysohn's lemma on $X \times Y = \Bbb{R}^2$. Consider the sets $A = \{(x, y) \in \Bbb{R}^2 : x \ge e^y\}$ and $B = \{(x, y) : x \le 0\}$. These are closed, disjoint sets in a normal toplogical space $\Bbb{R}^2$, hence by Urysohn, there must exist a function $f : \Bbb{R}^2 \to [0, 1]$ such that $f(A) = 0$ and $f(B) = 1$.
Since the entirety of $\{0\} \times Y$ lies in $B$, we have $g(0) = \inf_{y \in \Bbb{R}} f(0, y) = 1$. But, if we take $x > 0$, then $(x, \ln x) \in A$, so $g(x) = \inf_{y \in \Bbb{R}} f(x, y) \le f(x, \ln x) = 0$. Thus, $g$ is not continuous.