a.
$p*p = q$
$p*p*p = p*q \quad \quad$//left operation with $p$
$(p*p)*p = p*q \quad \quad$//associative property
$q*p = p*q \quad \quad\quad$//$p*p=q$
b.
For a semi-group, two properties are known: associativity and closure. (Identity is not required).
Closure means that $p*q$ must be a part of the semi-group.
This means, either $p=p*q$ or $q=p*q$ as the semi-group is $\left(\{p,q\},*\right)$
CASE 1: $p = p*q.$
This means, $p=p*p*p$ as $p*p = q \quad \to (1)$
Then, $q*q = \text{LHS} = p*p*p*p = p*p = q = \text{RHS}. ($From $(1)).$
CASE 2: $q = p*q.$
This means, $q=p*q = p*p*p\quad \to (2)$
Then, $q*q = \text{LHS} = p*p*p*p = p*q = q = \text{RHS}$ (based on Case $2's$ assumption).