Let $G$ be a compact group. If $\{a^n\}_{n \in \mathbb{Z}}$ is dense in $G$, then $G$ is abelian. It was used in the middle of a theorem's proof and I am not sure how to prove this fact.
 A: You need some other separation axiom like Hausdorff, otherwise there are simple counterexamples.  If $G$ is Hausdorff, then $D = \{(x,x):x \in G\}$ is closed in $G \times G$.  Hence $C_y = \{x \in G: xy = yx\}$ is closed, because it is the preimage of $D$ under the map $x \mapsto (xy,yx)$.  Hence $C_{a^n}$ is closed, and contains the dense subset $\{a^n:n\in \mathbb Z\}$.  Hence $C_{a^n} = G$.  Hence for any $x \in G$, we have that $x \in C_{a^n}$, which implies that $a^n \in C_x$.  Hence $C_x$ is closed and contains the dense subset $\{a^n:n\in \mathbb Z\}$.  Hence $C_x = G$.
A: Assume $G$ Hausdorff.
Given $z=xy\in G$ and an open set $A\ni z$ there exist open sets $U\ni x$ and $V\ni y$ in $G$ such that $UV\subset A$. Indeed the inverse image of $A$ under the multiplication map is open in $G\times G$ and thus contains some basic open set $U\times V$.
Suppose $xy\neq yx$ and let $A\in xy$ and $B\ni yx$ open sets separating the two points. Up to taking intersections, we may assume that $UV\subset A$ and $VU\subset B$. 
But by density of $\langle a\rangle$ in $G$, we can find $a^m\in U$ and $a^n\in V$. Thus $a^{m+n}\in UV\cap VU$ which is a contradiction.
A: For Metric Spaces: Because this set is dense, any $g,h \in G$ can be written as $\lim_{k \to \infty} a^{n_k}$ for sequence $\{n_k^{(g)}\}_{k \in \Bbb N},\{n_k^{(h)}\}_{k \in \Bbb N} \subset \Bbb Z$.  Because $G$ is a topological group, we have
$$
gh = \lim_{k \to \infty}a^{n_k^{(g)}}a^{n_k^{(h)}}
$$

In terms of nets: Note that the sequences $\{a^{n_k^{(g)}}\}$ and $\{a^{n_k^{(h)}}\}$ are convergent nets in $G$, so that $\{a^{n_k^{(g)}} \times a^{n_k^{(h)}}\}$ converges to $(g,h)$ in $G \times G$.
Because the group operation is continuous, it maps the convergent net in $G \times G$ to a convergent net in $G$, and the limit of this net is $gh$.  
If $G$ is Hausdorff, then the limit of this net is unique, and we may indeed say that 
$$
gh = \lim_{k \to \infty}a^{n_k^{(g)}}a^{n_k^{(h)}}
$$
As before.
A: If a subgroup H is dense in a group G, then the derived subgroup of H is dense in the derived subgroup of G.
In particular, if H is abelian, then the derived subgroup of G is trivial, so G is also abelian.
