If $ab = e$, then $ba = e$? $x\cdot (a\cdot b) = x\cdot e$
$(x\cdot a)\cdot b = x$
$e\cdot b = x$
$b = x$
Are my steps correct?
What I wanted to prove is that if $ab = e$, then $ba = e$
$x$ is inverse of $a$ and $e$ is identity element .

I'm not that sure what you did was correct. As always with maths, it depends a lot on the context.
If your context is that $a, b, x$ are elements of a group $G$, than it still depends how you did define group. To me it appears like you want to prove that if every element $a \in G$ has a right-inverse $b\in G$, i.e. $ab = e$, then $b$ is also a left-inverse.
If this is what you want to do, then I don't see why your second step is true. You seem to use $x\cdot a = e$, but why is this true?
On the other hand, if you suppose the existance of a right-inverse $b$ and a left-inverse $x$ than it looks fine.
