A non-abelian group of order $ 6 $ is isomorphic to $ S_3 $
Solution 1:
Here is an alternative answer:
By Cauchy's theorem, a group of order 6 has an element $x$ of order $2$ and an element $y$ of order $3$. These two elements generate the group. The 6 elements $e$, $y$, $y^2$, $x$,$xy$, $xy^2$ must all be different from each other, hence this is the list of all elements of the group. Therefore, $yx$ must be somewhere on this list.
Checking each element: we know that $yx\neq e$ because $x\neq y^{-1}$, $yx\neq y$ because $x\neq e$, $yx\neq y^2$ because $x\neq y$, $yx\neq x$ because $y\neq e$, and $yx\neq xy$ because by assumption the group is not abelian. Thus $yx=xy^2$, hence our group is the symmetric group $S_3$.
Solution 2:
Assume (for contradiction) that $xy = yx$.
When you consider the order of $xy$, it can only be equal to $2$ or $3$, because you've already argued that the group has no elements of order $6$ and $xy = e \Rightarrow x \in \langle y \rangle$, a contradiction.
If $xy$ had order $2$, then $e = (xy)^2 = x^2 y^2$ implies that $y = y^{-2} = x^2$ (using that $y$ has order $3$), forcing $x$ to have order $6$, a contradiction. To spell this out, clearly $x^6 = y^3 = e$, while if $x^k = e$, then $k \neq 2, 4$ because $y, y^2 \neq e$ while $k$ cannot be odd because in that case $x^k \in x \langle y \rangle$ which does not contain $e$.
Now suppose that the order of $xy$ is $3$. Then $e = (xy)^3 = x^3 y^3 = x^3$, so $x$ has order $3$. But $x^3 \in x \langle y \rangle$, a contradiction by the same argument as above.
This proves that $xy = y^2x$. If $x^2 \in x \langle y \rangle$, then $x \in \langle y \rangle$, which is false by hypothesis. So $x^2 \in \langle y \rangle$. We wish to show that $x^2 = e$, so we must rule out $x^2 = y$ and $x^2 = y^2$. If $y = x^2$, then as above, we argue that $x$ has order $6$, a contradiction. If $x^2 = y^2$, then $x^2$ has order $3$, so $x = x^4 = y^4 = y$, also a contradiction.
Once you know that $x^2 = y^3 = e$ and $xy = y^2x$, it is possible to construct an explicit isomorphism from $G$ to $S_3$.