Let $G$ be a finite group, and let $S$ be a nonempty subset of $G$. Suppose $S$ is closed with respect to multiplication. Prove that $S$ is a subgroup of $G$. (Hint: It remains to prove that $S$ contains $e$ and is closed with respect to inverses. Let $S = \{a_{1},...,a_{n} \}.$ If $a_{i} \in S$, consider the distinct elements $a_{i}a_{1}, a_{i}a_{2},...a_{i}a_{n}$.)
Preliminary questions: Can I assume that every element in $S$ unique? If each element is unique, then does that imply the products $a_{i}a_{1}, a_{i}a_{2},...a_{i}a_{n}$ are distinct? If I cannot assume that each element is not unique, then why should I just consider the distinct products?
(i). Show that $S$ contains $e$: Because we know $S$ is closed under multiplication, we know that each element in $S$ can be written as a product of elements in $S$. The book claims that I can write $a_{1} = a_{1}a_{k}$ for some $k$. I don't really understand why I can make such a claim. Does the following explain why? If $a_{1} \in S$ then will one of the following products $a_{1}a_{1}, a_{1}a_{2}, ... , a_{1}a_{n}$ be equal to one element in $S$ and eventually will every product be paired with each element in $S$? How do we know $a_{1} \neq a_{3}a_{2}$?
Because if I assume $a_{1} = a_{1}a_{k}$, then $a_{1}^{-1}a_{1} = a_{1}^{-1}a_{1}a_{k}$ shows that $e = a_{k}$. And I can still make use of $a_{1}^{-1}$ because if $a_{1} \in S$, then $a_{1} \in G$ and $a_{1}^{-1} \in G$ since $G$ is a group. Is this reasoning correct?
(ii). Show that every element $a_{p} \in S$ has an inverse $a_{p}^{-1} \in S$: Let $a_{p} \in S$, then we can write $a_{p} = a_{1}a_{q}$ for some $q$. We can rearrange and get $a_{q} = a_{1}^{-1}a_{p} = (a_{p}^{-1}a_{1})^{-1}$. At this point I've shown that $(a_{p}^{-1}a_{1})^{-1} \in S$, but now I have been stuck for a while. Could I get a hint?
Thanks in advance.
Update
(i). Show that $S$ contains $e$: Using the hint, ``If $a_{i} \in S$, consider the distinct elements $a_{i}a_{1}, a_{i}a_{2},...a_{i}a_{n}$," if $a_{1} \in S$, then we consider $a_{1}a_{1}, a_{1}a_{2},...a_{1}a_{n}$. Then we can write the following: \begin{align*} a_{1} &= a_{1}a_{k} \newline a_{1}^{-1}a_{1} &= a_{1}^{-1}a_{1}a_{k} \newline e &= ea_{k} \newline e &= a_{k} \end{align*}
(ii). Show that every element $a_{p} \in S$ has an inverse $a_{p}^{-1} \in S$: To show that $e \in S$, we can write $a_{1}a_{p} = e$ for $a_{1}, a_{p} \in S$ \begin{align*} a_{1}a_{p} &= e\newline a_{1}a_{p}a_{p}^{-1} &= ea_{p}^{-1}\newline a_{1} &= a_{p}^{-1} \end{align*}