Suppose that $G$ is a compact Hausdorff topological group and that $g\in G$. Consider the set $A=\{g^n : n=0,1,2,\ldots\}$ and let $\bar{A}$ denote the closure of $A$ in $G$.
Is it true that $\mathbf{\bar{A}}$ is a subgroup of $\mathbf{G}$?
From continuity of multiplication and the fact that $A\cdot A\subseteq A$ it is clear that $\bar{A}\cdot\bar{A}\subseteq\bar{A}$. therefore, $a,b\in \bar{A}$ yields $a\cdot b\in \bar{A}$. However, I am having trouble showing that inverses of elements in $\bar{A}$ are also in $\bar{A}$.
Let $B=\{g^{n}:n\in\mathbb{Z}\}$. Clearly $\bar{B}$ is also a subgroup of $G$.
If $1$ is an isolated point in $\bar{B}$ then all points of $\bar{B}$ are isolated, which means that $\bar{B}$ is compact and discrete, and hence finite. Thus, $g^{n}=1$ for some $n$ and so $\bar{A}$ is a subgroup of $G$.
On the other hand, if $1$ is a limit point in $\bar{B}$ then for any symmetric neighborhood $V$ of $1$ there is a positive integer $n$ such that $g^{n}\in V$ ($n>0$ is possible since $V$ is symmetric). Then $g^{n-1}\in(g^{-1}V)\cap A$, and since the $g^{-1}V$ form a neighborhood basis at $g^{-1}$ we have that $g^{-1}\in \bar{A}$. This means that $\bar{A}=\bar{B}$ and so $\bar{A}$ is a subgroup of $G$.