Prove that a set $S$ of number has a maximum if and only if it is bounded above and $\sup S$ belongs to $S$ 
Prove that a set $S$ of number has a maximum if and only if it is bounded above and $\sup S$ belongs to $S$


Case 1: if set $S$ is bounded above and $\sup S$ belongs to $S$, then set $S$ has a maximum. 
Case 2: if set $S$ has a maximum, then $S$ is bounded above and $\sup S$ belongs to $S$.

case 1: 
Since $S$ is bounded above, there exists a least upper bound $b$ such that for any number $x\in S$,$x\leq b$. Because $\sup S\in S$, so $b=\sup S$; thus $\max S=\sup S$.
case 2:
Since the non-empty set $S$ has a maximum,let's called it $m$, then $S$ is bounded above and $m$ is an upper bound for $S$ because for each number $x\in S$, $x\leq m$. And since $m\in S$, for any upper bound $M$ in $S$, $m\leq M$; hence $m=\sup S$ which shows that $\sup S\in S$.

I don't think my proof is correct because it seems I miss some details and I still don't quite understand what supremum is for a non-empty set. So far I know, a supremum is the greatest upper bound for a non-empty set.
Could anyone give me a hit or suggestion to write a better proof ? Thanks. 
 A: Your proof seems fine. Just in case, here's a minimally different argument using an equivalent definition of the supremum. Given a set $S$, we say that $\alpha$ is the supremum of $S$ if the following conditions hold:


*

*$\alpha$ is an upper bound of $S$, this is $\forall x \in S, x\le \alpha$

*$\alpha$ is the smallest upper bound of $S$, this is $\forall \beta < \alpha, \beta$ is not an upper bound of $S$. 
Now suppose that $\alpha \in S$. The first condition implies that $\alpha$ is the maximum of $S$. This is simply using the definition: we say that $\gamma$ is the maximum of $S$ if $\gamma \in S$ and $\forall x \in \gamma, x\le \gamma$. 
Conversely, if $m$ is the maximum of $S$, it is immediate that $m$ verifies the conditions above, hence $m$ is the supremum of $S$ (we are implicitly using that the supremum of a set if unique, this follows easily from the definition).
A: Your proof looks mostly fine to me. We know that supremums and maximums are both upper bounds, so the important thing is to show that being a least upper bound is the same as being an upper bound in the set.
I think I'd go into more detail in the last sentence of Case 2. Why does $m \in S$ imply $m \leq M$ for any upper bound $M$ of $S?$ (I suppose proving by contradiction will work here.)
Regarding empty sets, the supremum is often defined to be $-\infty.$ This is because any real number satisfies the condition of being a supremum. So the smallest real number will be the supremum. But note that in the question, we can deduce S is non-empty. In Case 1, $\sup S\in S$ and in Case 2, $\max S \in S,$ so S is certainly non-empty in both cases.
