Suppose that $*$ is an associative and commutative binary operation on a set S. Show that the subset $$T=\{a \in S \mid a*a=a \}$$ of $S$ is closed under $*$.
Proof: We need to show that if $a\in T$ and $b \in T $, then $a*b\in T$ Let $a\in T$ and $b \in T$, so $a \in S$ and $b \in S$ which implies $a*b \in S$. $a*b=(a*a)*(b*b)$ and since $*$ is associative , we can get rid of the parenthesis, so $(a*a)*(b*b)=a*a*b*b$. * is also commutative, so $a*a*b*b=a*b*a*b$. We can also ad back parenthesis to make it more clear, $a*b*a*b=(a*b)*(a*b)$, so $a*b\in T$ which implies $T$ of $S$ is closed under $*$
How does that look?
The second sentence of your proof begins with a symbol which is sometimes frowned upon. You can insert some words such as 'Note that' or 'We have' to avoid this.
Instead of 'hence', you should 'since' (you are using the properties of $\ast$ you were given, you are not concluding something about $\ast$).
I think you should show some more steps to justify the equation $a\ast b = (a\ast b)\ast(a\ast b)$. Something along the lines of
\begin{align*} a\ast b &= (a\ast a)\ast (b\ast b)\\ &= a \ast (a \ast b) \ast b\\ &= a \ast (b\ast a) \ast b\\ &= (a\ast b)\ast(a\ast b). \end{align*}
Instead of saying 'which implies $T$ of $S$ is closed under $\ast$', I think you should say something of the lines of 'which shows $T$ is closed under $\ast$'.
Despite my comments on how your proof is written, your approach to the proof is correct.