TITLE: Abstract algebra subgroup proof verification
QUESTION [8 upvotes]: This is my first attempt at a formally written proof so I would appreciate any pointers as far as proof-writing technique or the validity of the actual proof itself. 
Note: I have not formally taken abstract algebra or a proof-writing course so I am sure that I am lacking in many proof-writing aspects, so I would really love a lot of constructive criticism both on the actual proof itself, and the way I wrote the proof. I also go into greater detail than might be appropriate for this type of proof because I am shaky on a lot of the math foundations so I figure that any imperfections in my knowledge will be more easily seen with a more explicit construction of this proof. Thank you all in advance.

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$ $∈$ $S$, consider the distinct elements $a_ia_1$, $a_ia_2$, $...$ $a_ia_n$

Proof:
First we will define a function $A_1 : S \rightarrow S$ that maps $s \mapsto a_1s$. This function is injective because $$a_1y = a_1x$$ $$a^{-1}_1a_1y = a^{-1}_1a_1x$$ $$y = x$$
The function is then surjective because $A_1(S) \subseteq S$ and since $A_1$ is injective, it contains $|S|$ elements. Therefore $A_1$ maps onto every element in $S$ and is therefore surjective as well.
This means that $a_1$ is in the image of $A_1$. Therefore $$A_1(a_1) = a_1$$ $$a_1s = a_1$$ $$s = e$$
Since $S$ is closed under multiplication, $e \in S$.
Next, we will define a function $A_2 : S \rightarrow S$ that maps $s \mapsto a^2_1s$. This function is also injective $$a^2_1x = a^2_1y$$ $$x = y$$
It follows that this function is also surjective since it too is injective and contains |S| elements.
This means that $a_1$ is in the image of $A_2$ as well. Therefore $$A_2(z) = a_1$$ $$a^2_1z = a_1$$ $$z = a^{-1}_1$$
Since $S$ is closed under multiplication $a^{-1}_1 \in S$.
Therefore $e, a^{-1}_1 \in S$ so $S$ is a subgroup of $G$.
Please tear this apart! Thanks in advance.

REPLY [2 votes]: The proof presented here by our OP ForIgreaterthan_I appears to be logically valid; indeed, I like it because it is clever and innovative.  
The way I would approach this, which alas is standard and not in fact overly clever, being as it is indeed rather obvious and straightforward, is as follows:
Let
$s \in S; \tag 1$
consider the powers 
$s^i \in S; \tag 2$
since
$S \subset G \tag 3$
and 
$\vert G \vert < \infty, \tag 4$
we have
$\vert S \vert < \infty \tag 5$
as well; thus the sequence
$s, s^2, s^3, \ldots, s^i, s^{i + 1}, \ldots \tag 6$
must repeat itself at some point; that is, 
$\exists k, l \in \Bbb N, \; l \ge k + 1, \tag 7$
with
$s^l = s^k; \tag 8$
then
$s^{l - k} = e; \tag 9$
thus
$e = s^{l - k} \in S; \tag{10}$
it follows then that
$s^{l - k - 1}s = e \tag{11}$
and clearly
$s^{l - k - 1} \in S; \tag{12}$
thus the group identity $e \in S$, and every $s \in S$ has an inverse in $S$; $S$ is thus a subgroup of $G$.