# For continuous and bounded $f(x,y)$ prove $g(x)=\sup_y f(x,y)$ is continuous too

Suppose $f(x,y)$ is continuous and bounded. Please prove $g(x)=\sup_y f(x,y)$ is continuous too.

• Do you mean $f: \mathbb R\times \mathbb R \to \mathbb R$? Do you mean $\sup\limits_{y\in\mathbb R} f(x,y)$? – Martin Sleziak Apr 18 '11 at 13:08
• What have you tried so far? After you try enough things, and they don't work, they may suggest how to look for a counterexample. Or after looking for a counterexample, and that doesn't work, it may suggest how to prove it. – GEdgar Apr 18 '11 at 13:11
• @martin: thanks for reply! The domain of $f$ is a region, unknown if it is the 2-v plane or not. The Image of $f$ is real number set. – abc Apr 18 '11 at 13:16

Another example with no weird domain : $f : \mathbb{R}^2 \to \mathbb{R} ; (x,y) \mapsto \inf(1,|xy|)$ is continuous but $g(x) = 1$ except for $x=0$ where $g(0)=0$.

If the domain is only a region, this is false. Consider the function $f(x,y) = y$ defined on the region

$$G = \{ -1 \leq y \leq 0 \} \cup \{ 0 \leq y \leq 1, y \geq -x \}$$

Define $f$ by $f(x,y)=y$ on the L-shaped domain made of the top-left, bottom-left and bottom-right unit squares in $[-1,1]^2$. That is, the domain is the union of $[-1,1]\times[-1,0]$ and $[0,1]\times[-1,0]$. Then $g(x)=1$ if $x<0$ and $g(x)=0$ if $x>0$.