Your proof is mostly OK, except for the fact that it's not a proof of your original statement.
You are trying to prove that any set with greatest lower bounds automatically has least upper bounds. In your proof, you fix an arbitrary subset $B$ of a set $S$ with greatest lower bounds, and then show that a completely different set $A$ has a least upper bound. Instead, you need to show that $B$ has least upper bounds. Let's see how we can alter your proof so that it proves your original statement.
Let $B$ be a nonempty subset of $S$ that is bounded below.
This is (almost) a great place to start. If you're trying to prove something about all objects in a class, it is always good to start by fixing an arbitrary one. But here, you want to show that any non-empty bounded above subset of $S$ has a least upper bound, so you should be fixing $B$ to be a non-empty bounded above subset of $S$.
Let $a\in A$ be the set of all lower bounds of $B$.
First of all, I think you meant to say 'Let $A$ be the set of all lower bounds of $B$'. But even this is not what you want to do. Fixing $A$ to be the set of lower bounds of $B$ can't help you at all, since the only interesting thing you can say about $A$ is that it has a greatest element ($\inf B$), which is equivalent to $B$ having a greatest lower bound. You certainly can't apply the greatest lower bound property to $A$ - you don't even know that $A$ is bounded and $\inf A$, if it exists, is certainly unrelated to $B$.
At some point, you have to apply the greatest lower bound property to some set $C\subset S$, since you can't conclude that $S$ has the least upper bound property if you don't know that it has the greatest lower bound property (e.g., $\mathbb Q$ does not have the greatest lower bound property), but you have to apply it to a set that you know has a greatest lower bound; i.e., a set that is bounded below. Furthermore, it's going to have to be a set of elements that are $\ge$ the elements of $B$; otherwise, it'll have nothing to do with upper bounds of $B$ at all.
The solution, of course, is to fix $C$ to be the set of upper bounds for $B$. Now we're trying to show that $C$ has a least element.
There also exists an element $b\in B$ for all $a$ such that $a\le b$, so $A$ is bounded above (by $b$).
First of all, we aren't interested in saying that $A$ (or $C$) is bounded above, since being bounded above doesn't tell us anything. Being bounded below, of course, tells us that a set has a greatest lower bound. So we want to show that $C$ is bounded below. Secondly, it is ambiguous whether you mean that there is some $b$ that works for all $A$ or whether there is a separate $b(a)$ for each $a$. Both are true, but only the first implies your conclusion.
I'd prefer to write, 'Fix an arbitrary $b\in B$. Then for each $c\in C$, $c$ is an upper bound for $B$ so, in particular, $b\le c$. So $C$ is bounded below by $b$.'
Since $S$ satisfies the greatest lower bound property, $\inf \hspace{2 pt} B = \alpha$ exists for all $a$ such that $a \leq \alpha \leq b$.
This is where you started to go off the rails. Knowing that $B$ has a greatest lower bound can tell you nothing about whether it has a least upper bound. For example, the set $\{3,3.1,3.14,3.141,3.1415,3.14159,\dots\}$ has a greatest lower bound but no least upper bound in $\mathbb Q$.
I think I've given you enough clues for you to finish the proof on your own. For reference, here is my proof of the statement:
Let $B$ be a non-empty subset of $S$ that is bounded above, and let $C$ be the set of all upper bounds for $B$. Fix $b\in B$; then, for each $c\in C$, $c$ is an upper bound for $B$ so, in particular, $b\le c$. So $C$ is bounded below by $b$, which means that it has a greatest lower bound $\gamma$. Since every $b\in B$ is a lower bound for $C$, $\gamma\ge b$ for each $b\in B$. So $\gamma$ is an upper bound for $B$, and is clearly the least upper bound since it is a lower bound for the set of upper bounds. $\Box$
I'm interpreting the question as asking to prove that given an ordered field $\mathbb F$, if $\mathbb F$ has the lub property, then $\mathbb F$ has the glb property. Or equivalentely that if all non-empty bounded above subsets of $\mathbb F$ have a supremum, then all non-empty and bounded below subsets of $\mathbb F$ have an infimum.
Ordered fields are irrelevant here, this can be generalized to any poset.
Let $P$ be a poset such that each of its non-empty and bounded above subsets has a supremum.
The goal is to prove that any non-empty and bounded below subset $A$ of $P$ has an infimum.
Being a universal statement, one way to prove it is to start by taking an arbitrary non-empty and bounded below subset $A$ of $P$.
Now consider the set $\downarrow A$, where $\downarrow A:=\{p\in P\colon \forall a\in A(p\leq a)\}$, that is, consider the set the lower bounds of $A$.
The set $\downarrow A$ isn't empty because $A$ is bounded below. It is also bounded above by any element of $A$.
Hence it's possible to use the hypothesis that any non-empty and bounded above subset of $P$ has a supremum particularized to $\downarrow A$.
Let $s:=\sup\left(\downarrow A\right)$.
Claim: $s=\inf(A)$.
Proof: It suffices to prove that $s$ is a lower bound of $A$ and that $\forall p\in \downarrow A(p\leq s)$. The latter part follows immediately from the fact that $s$ is an upper bound of $\downarrow A$. The first part follows from the fact that any element of $A$ is an upperbound of $\downarrow A$ and hence greater than the supremum of $\downarrow A$ which is $s$.
Since $A$ was an arbitrary bounded below and non-empty subset of $P$, it wasproved that $P$ has the glp property.
Best Answer
The g.l.b. and l.u.b. from analysis that you mention are with respect to the usual partial order (in fact, total order) $\leq$. Indeed, we have $2 \leq 3 \leq 4 \leq 6$, so the g.l.b. w.r.t. $\leq$ is $2$ and the l.u.b. is $6$.
The problem at hand specifies a different partial order, namely $\preceq$ (or $\mid$). In this case, we have, for example, neither $3 \preceq 4$ nor $4 \preceq 3$. The only elements $x \in X$ such that $2 \preceq x$, $3 \preceq x$, $4 \preceq x$, and $6 \preceq x$ are $12$ and $24$, and $12 \preceq 24$, so $12$ is a l.u.b. for $\{2, 3, 4, 6\}$. (Like you note, $12$ is not an element of that subset!)
On the set $\Bbb Z_+$ of positive integers, again endowed with the divisibility partial order, the g.l.b. of a finite set of integers $A \subset \Bbb Z_+$ is, by definition, the greatest common divisor of the elements of $A$, and likewise the l.u.b. of $A$ is the least common multiple.