Prove that sup $f(x)$ $\le$ inf $g(y)$. (proof verification) I saw this proof, but I don't understand one point.
$f(x) \le g(y)$ for $x,y \in D$ 
$\rightarrow$ sup$f(x)$ $\le$ $g(y)$    
$\rightarrow$sup$f(x)$ $\le$ inf$g(y)$
I think from the second line to third line of proof, it assumes that inf$g(y)$ $\in$ $g(D)$. 
But, how can we prove this? 
Thanks in advance. 
 A: The property that they use is let $a \in \mathbb{R}$. Then $\forall y, a \le g(y) \implies  a \le \inf_y g(y)$. 
$a$ is a lower bound for the set $\{ g(y): y \in D\}$, but remember that the infimum is the greatest lower bound, hence we have $a \le \inf_y g(y)$.
Here $a$ is $\sup f(x)$.
A: Take any $\epsilon > 0$, then there exists $x$ such that
$$\sup f - f(x) < \epsilon $$
similarly there exists a $y$ such that
$$ g(y) - \inf g <  \epsilon$$
Then
$$\sup f < \epsilon + f(x) \leq \epsilon + g(y) <\epsilon +\left( \inf g + \epsilon\right)
= \inf g + 2\epsilon$$
As $\sup f < \inf g + 2\epsilon$ for all $\epsilon > 0$, letting $\epsilon \to 0^+$ gives
$$\sup f \leq \inf g$$
A: You do not need to assume that $\inf g\in g(D)$. Assume by way of contradiction that $\sup f> \inf g$. Then there exists some $\delta>0$ such that $\sup f>\inf g+\delta$. By definition of the infimum there exists some $y\in D$ such that $\inf g\leq g(y)\leq \inf g +\delta$. Thus $g(y)<\sup f$, contradicting part $2$ of your proof.
A: Since $f(x)\le g(y)$ for $x$,$y\in D$
$g(y)$ is an upper bound for $f(x)$, so the least upper bound is less than or equal $g(y)$
Thus  $\sup f(x) \le g(y)$.
That implies $\sup f(x)$ is a lower bound for $g(y)$ so the greatest lower bound  of $g(y)$ is greater than  or equal to sup $f(x)$. 
That is: 
$\sup f(x) \le \inf g(y)$
