Suppose that $f:X\times Y\to \mathbb R$ is continuous, and let $g(x)=\inf_{y\in Y} f(x,y)$. As the example $f(x,y)=xy^2$ shows, if we allow ourselves to take values in the extended reals, $g(x)=0$ if $x\geq 0$ and $-\infty$ otherwise, so $g(x)$ need not be continuous.
Are there natural conditions that will guarantee that $g$ is continuous? What if $X$ or $Y$ is compact? Or the infimum is always finite? Or if $X$ and $Y$ are metric spaces and $f$ is uniformly continuous?
For reference, I’d possible, I would like a condition that would apply to the example $f((a,b),x)=x^2+ax+b$, where it is easy to verify computationally that the statement is true. I’m particular, I would like to avoid requiring compactness if possible.