Is this structure a group?

Choose some element $s\in S$. Since $s$ has finite order, there exist positive integers $a<b$ such that $s^a=s^b$; let $n=b-a$. Now consider any $t\in S$, and observe that $s^as^nt=s^bt=s^at$. Cancelling $s^a$, we see that $s^nt=t$. Similarly, $ts^n=t$. Thus $s^n$ is an identity. It follows that $S$ is a group (indeed, the argument above shows that any element of $S$ has some power which is the identity).

More generally, a similar argument shows that if a semigroup $S$ has elements $x$ and $y$ such that $xy=x$ and $x$ is cancellable, then there is an identity element (namely $y$). (To show $y$ is a right identity, observe first that $xyx=x^2$ and so $yx=x$.)


so the set of $A= \{a^k|k\in \mathbb N\}$ is finite. It's easy to show that $A=\{a,a^2, .... a^m\}$ some $m$ and then $a^{i}; 1\le i\le m$ are distinct.

Now $a^{m+1} = a^k$ for some $1\le k\le m$. If $k > 1$ then $a^m = a^{k-1}$ which is a contradiction. So $a^{m+1} = a$ and $a^ia^m = a^ma^i= a^{m+1}a^{i-1} =aa^{i-1} = a^i= a^i$ so $a^m$ acts as an identity element on all $a^i$.

Similarly for $b\in S$ there is a $b^n$ that acts as an identity on $b^i$. $a^{2m}b= a^mb^{n+1}$. so $a^mb = b^{n+1} = b$ and likewise $ba^m = b^{n+1}a^{2m}$ so $b = b^{n+1}a^m = ba^m$. So $a^m$ will also act as an identity element on $b$.