At first, why did you suppose that $\inf X$ does exist? Think of $\mathbb{R}$, which is unbounded below.
Now, nack to our proof. Let $E$ be a bounded from above, non-empty subset of $X$. Since we only know that $X$ has the g.l.b. property, we need to construct a set that is bounded from below and, of course is non-empty. So, since $E$ is bounded from above, there exists an $a\in X$ such that:
$$x\leq a\ \forall x\in E$$
Now, consider
$$F:=\{x\in X:x\geq y,\ \forall y\in E\}$$
So, it is clear that $a\in F$, so $\varnothing\neq F\subseteq X$. Moreover, since $E$ is non-empty, there exists a $b\in E$, so, it is clear by $F$'s definition, that:
$$b\leq x,\ \forall x\in F$$
so $F$ is bounded from below. Due to our hypothesis, there exists an $s\in X$ such that:
$$s=\inf F$$
Now, we claim that $s\in X$ is an upper bound of $E$.
Let us suppose that there exists a $x\in E$ such that
$$x>s$$
Then, by $F$'s definition, there should exist no $y\in F$ such that $$s\leq y\leq x$$
since for every $y\in F$ we have that $y>x$
So, $x$ is a greater than $s$ lesser bound for $F$, which is a contradiction. So $$x\leq s, \forall x\in E$$
Now, if $s\in E$, then it is clear that $s=\sup E$. If $s\not\in E$, let $t$ be another upper bound of $E$ with
$$t<s$$
Then, since $t$ is an upper bound it is clear that $t\in F$, which is a contradiction, since, then:
$$s=\inf F\leq t<s$$
So, $$s=\sup E$$