Is such a condition possible for the provided group? So I came across this question in Gallian's book where we have to prove that a group G is abelian when for every x belonging to G | $x^2=e$ where e is an identity element.

So while thinking about $x^2=e$ , I stumbled upon the idea that -
=> $x^2=e$
=>  $x\circ x=e$ | $\circ$ = binary operation
But $x\circ x=e$ will only be possible if $x=x^{-1}$ ($x$ inverse) because only then 
$x\circ x = x\circ x^{-1} = e$

So possible that $x=x^{-1}$ in this case ?
You are correct! By definition, the element $x^{-1}$ is the unique element such that $xx^{-1} = x^{-1}x= e$. Since $x(x) = (x)x = e$, we have that $x=x^{-1}$. 

To show that this insight is instrumental in proving that $G$ is abelian, I’ll give you a hint! 


  Let $x$ and $y$ be any two elements. We want to show that $xy=yx$. Since $xy\in G$, what can we say about $(xy)^{-1}$?
How about $\mathbb Z_2^ n$?  By which I mean a direct product of $n$ copies of $\mathbb Z_2$...