You can solve universal algebra problems like this one using tools such as Prover9 and Mace4 which (respectively) try to find proofs from assumptions or find countermodels.
In the syntax of Prover9 we write your problem as
op(500, infix, "*").
formulas(assumptions).
(x * y) * y = x.
y * (y * x) = x.
end_of_list.
formulas(goals).
x * y = y * x.
end_of_list.
where we first introduce a new infix operation *, then supply a list of axioms * satisfies, then provide a list of "goals" which we're interested in. If we save this file as test.in and run Prover9 -f test.in we get a whole bunch of output ending with the satisfying THEOREM PROVED.
The important part of the output is shown here:
============================== PROOF =================================
% Proof 1 at 0.00 (+ 0.00) seconds.
% Length of proof is 7.
% Level of proof is 3.
% Maximum clause weight is 7.000.
% Given clauses 4.
1 x * y = y * x # label(non_clause) # label(goal). [goal].
2 (x * y) * y = x. [assumption].
3 x * (x * y) = y. [assumption].
4 c2 * c1 != c1 * c2. [deny(1)].
5 x * (y * x) = y. [para(3(a,1),2(a,1,1))].
7 x * y = y * x. [para(2(a,1),5(a,1,2))].
8 $F. [resolve(7,a,4,a)].
============================== end of proof ==========================
With some effort one can turn this proof into something human readable:
Start with
- (2) $(x * y) * y = x$
- (3) $x * (x * y) = y$
then substitute $x = a$ and $y = (a * b)$ into (2) to get $(a * (a * b)) * (a * b) = a$, using (3) we can simplify this to $b * (a * b) = a$. Prover9 writes everything in terms of xs and ys instead of using fresh variables, so it writes this as
Finally set $x = a$ and $y = (b * a)$ in (5) to see $a * ((b * a) * a) = b * a$, and use (2) to get $a * b = b * a$, which Prover9 writes as
The other lines (1,4, and 8) are because Prover9 always uses proof by contradiction.
I hope this helps ^_^