How to prove the order of an element is the same as the order of the subgroup generated by that element? Let $G$ be a group and $g \in G$.
Define $\langle g\rangle$ to be the smallest subgroup of $G$ containing $g$.
Define $o(g)$ to the the order of the element $g$. That is the smallest natural number $d$ such that $a^d=1$ the identity.
Is it true for all groups that $o(g)|G$?
I know by Lagrange's theorem we get $\langle g \rangle$|G so if we can show that  $o(g)=\langle g \rangle$ then we are done but I don't know how to show this.
Is it just because $\langle g \rangle=\{g^0,g^1,...,g^{d-1}\}$?
Thanks.
 A: Seems that you want to prove that $\langle g\rangle = \{ g^0,g^1,\ldots, g^{d-1} \}$ where $d = o(g)$. 
First, we can see that the right hand side is a subgroup of $G$ containing $g$: We have $g^0=1$ the identity. Also, $(g^i)^{-1} = g^{d-i}$ for $i=0,\ldots,d-1$. Furthermore, for $i,j=0,\ldots,d-1$, using integer division, we have $i+j=kd+r$ for some $k\geq 0$ and $0 \leq r < d$, thus $g^ig^j=g^{i+j}=g^{kd+r}=g^r$.
Now let $H\subset G$ be a subgroup containing $g$. Then $H$ has to contain $g^2,g^3,\ldots$ as well since a group is closed under multiplication. Hence $\{1,g^1,\ldots,g^{d-1}\}\subset H$. Therefore $\{g^0,g^1,\ldots,g^{d-1}\}$ is the smallest subgroup containing $g$.
A: 
Is it just because $\langle g \rangle = \{g^0, g^1, \dots, g^{d - 1}\}$?

Yes it is. But you still need to show that $| \{e, g, \dots, g^{o(g)-1} \} | = o(g)$.
For this, we need  all elements in the above set to be different, i.e. for each $n,m \in \mathbb{N}$ with $0 \leq n < m \leq o(g)$ we want $g^n \neq g^m$. For the sake of contradition, suppose that there exist $n, m$ as above such that 
$$g^n = g^m.$$ 
Then 
$$g^n g^{o(g) - m} = g^m g^{o(g) - m} = g^{o(g)} = e$$
But $n + o(g) - m < o(g)$. A contradiction to the minimality of $o(g)$.
