I found the Proof Here Showing group with $p^2$ elements is Abelian , But here some proof are complicated , those who are beginner in algebra will difficult them to understand
Theorem : If ${\rm order}(G) = |G|= p^2 $, where $p$ is prime number, then $G$ is abelian.
My attempt : Possible of $|Z(G)|$ are $1 , p , p^2$
Step $1:$
We must know one theorem for this proof , that is if $order (G) =p^n $, where $p$ is prime number , then $Z(G) \neq (e) $or u can say that $ order(Z(G)) > 1$
Proof : We know that class equation of $G$ is
$|G| = \sum_{N(a) = |G|} \frac{|G|}{|N(a)|} + \sum_{N(a) \neq |G|} \frac{|G|}{|N(a)|}= |Z(G)| + \sum_{a \notin Z(G)} \frac{|G|}{|N(a)|} $
by Lagrange's Theorem ,$|N(a)|$ divide $|G|$ for each $a \notin Z$, Now take $|N(a) |=p^k$ where $0 < k <n$ , we will get $\frac{|G|}{|N(a)|}= p^{n-k}$
$p$ divide $\frac{|G|}{|N(a)|}$ whenever $a \notin Z(G)$ that implies $p$ divide $\sum_{a \notin Z(G)} \frac{|G|}{|N(a)|} .$
We also know that $|G|= p^n$ so $p$ will divide $|G| -\sum_{a \notin Z(G)} \frac{|G|}{|N(a)|} $---(from class equation $G$)
So $p$ will divide $|Z(G)|$
from the above modulo $p$, we have that $|Z(G)|\equiv 0\pmod{p}$, when $|Z(G)|>1$.
So Now theorem is proof, and $|Z(G)|= 1$ is rejected.
Step $ 2:$
Let $|Z(G)|= p^2$, then $|G|= |Z(G)| $ implies $G=Z(G)$ since $Z(G)$ is subgroup of $ G$.This show the behaviour of abelian Group because for any $a \in G $ implies $ a \in Z(G)$ that will hit $ax= xa$ for all $x, a \in G$ so ,$|G| = p^2$ is abelian.
So $|Z(G)|= p^2$ is accepted.
Step $3$:
Let $|Z(G)| = p $, we know that $Z(G)$ is a proper subgroup of $G$ so that there exist some $a \in G $ such that $a \notin Z(G)$.
We also know that $N(a) = \{ x \in G : xa = ax \}$ is a subgroup of $G$ . we also know that $Z(G) \subset N(a)$ because $Z(G) = \{x \in G : gx = xg \textrm{ } \forall g \in G \}$. Hence, if $x \in Z(G)$ then $xa = ax$ i.e. $x \in N(a)$.
Here we already said in first sentence that $a \notin Z(G)$ , so $a \in N(a)$.
By lagrange theorem , we have $|N(a)|$ divide $|G|$ .Its show that $|N(a)|$ must be greater than $p$ because $|G|= p^2$.
Consequently $|N(a)| = p^2$ implies $|N(a)|=|G|$ so $N(a)= G$ because $ N(a)$ is a subgroup of $G$. Now $x \in N(a)$ for all $x \in G$ its implies $ax = xa$ for all $ x\in G $.
Now from Step $:2$, it show that $a \in Z(G)$ which is contradiction because $a \notin Z(G) $ (read the first sentence again).
So $|Z(G)|= p$ is rejected.