# Max operator preserving continuous functions

Suppose you have a function $f(x,y)$ where $x \in \mathcal X$ and $y \in \mathcal Y$ such that we know for each fixed $y$, $f$ is continuous in $x$. Now define the function $g(x) = \max_{y \in Y} f(x,y)$. What would you need in order to show that $g$ is continuous in $x$?

-
For one thing, you will need $g$ to be well-defined in all cases: if both domains are $\mathbb{R}$ and $f(x,y) = x + y$, there is no maximum. –  Dan Brumleve Jan 7 '13 at 10:11