Getting the wrong order of a finitely presented group 
Let $G=\langle x, y \mid x^4=y^3=1, y^{-1}xy=x^{-1}\rangle$. What is $G$? 

I started by taking 
$$y^2=y^{-1}xy y^{-1}x^{-1}= (y^{-1}xy) y^{-1}x^{-1}=x^{-1}y^{-1}x^{-1}=x^{-1}y^{-1}(y^{-1}xy)=x^{-1}yxy$$ which implies that $y=x^{-1}yx$ and hence $xy=yx$, i.e $G $ is abelian! But actually the question is to show that this group is of order $12$. So if my solution is not correct, what is $G$?
 A: There is an error in the question.
As your computation shows, $x$ and $y$ commute (i.e. $G$ is abelian). As such, the relation $y^{-1}xy = x^{-1}$ simplifies to $x = x^{-1}$, so $x$ actually satisfies $x^2 = 1$. Therefore, an alternative presentation for $G$ is 
$$\langle x, y \mid x^2 = y^3 = 1, xy = yx\rangle$$
from which it follows that $G \cong \mathbb{Z}_2\times\mathbb{Z}_3$; in particular, $G$ has order $6$, not $12$.
This can be confirmed using the Magma Online Calculator by using the following code
F<a, b> := FreeGroup(2);

G<x, y>, phi := quo< F | a^4, b^3, b^-1*a*b=a^-1 >;

#G

which computes the order of the group (and returns $6$).
A: Agree with others that there is an error in the question.  I just want to talk more about how you can see this...
The intention seems to be giving a presentation constructing an (internal) semidirect product in a $12$ element group, $W$, between a 4-cycle, $X = \langle x \mid x^4 \rangle \trianglelefteq W$, and a 3-cycle, $Y = \langle y \mid y^3 \rangle \leq W$, where $y$ acts on $x$ by conjugation, taking $x$ to $x^{-1}$, i.e. $y^{-1} x y = x^{-1}$.
But there's a problem.  This action is an automorphism of $X$, but the automorphism has order $2$ and $y$ has order $3$, so we should see something odd happen if we conjugate $x$ three times:  $$\begin{align}
x = 1 \cdot x \cdot 1 = (y^3)^{-1} x y^3 &= y^{-1}\left( y^{-1}\left( y^{-1} x y \right) y \right) y \\
    &= y^{-1}\left( y^{-1} x^{-1}  y \right) y \\
    &= y^{-1}\left( y^{-1} x  y \right)^{-1} y \\
    &= y^{-1} x y \\
    &= x^{-1}
\end{align}$$
(This is the semidirect product version of the previous simple fact about group elements:  a group element being of order dividing both $2$ and $3$ has order $1$.)
In $X$, there are only two elements of order $4$, $x$ and $x^{-1}$, so an automorphism may only send the generator $x$ to one of them.  This gives $\mathrm{Aut}\ X$ the structure of $\Bbb{Z}/2\Bbb{Z}$.  Now $y$ has order $3$, so must be sent to an element of $\mathrm{Aut}\ X$ having order dividing $3$.  The only such element is the identity, so the only semidirect product of order $12$ is actually the direct product $\langle x,y \mid x^4, y^3, y^{-1}xy = x \rangle$.  (I.e., conjugation by $y$ is the identity automorphism, taking $x$ to $x$.)  So the group is Abelian.
Since $y$ is not sent to the only compatible automorphism, the mismatched orders of $y$ and the inversion automorphism yield an extra relation, $x = x^{-1}$, shrinking the resulting group.  Note that there's not enough here to deduce that the group has $6$ elements.  We can only conclude that $|G| \leq 6$.  But we can say that $\{1, x, y, xy, y^2, xy^2\}$ is a complete (perhaps overcomplete) list of elements of the Abelian group $G$.  There's only one Abelian group of order $6$, so now we need to find an injective homomorphism $\varphi:\Bbb{Z}/6\Bbb{Z} \rightarrow \{1, x, y, xy, y^2, xy^2\}$.  I'm not going to work out the details, but $[1]_6 \mapsto xy$ seems like a good place to start.  (You need to map to something that reasonably has order $6$.  The first three elements in the list have orders $1$, $2$, and $3$, respectively, so $xy$ is a good place to start.)
A: Now that you have proved them to commute every element is of the form $x^r y^s$ with bounds $0\le r<4, 0\le s<3$. That makes it a group of order 12. 
Actually the two cyclic  groups generated by $x$ and $y$ commute and have only the identity element in common and every element is of the form $x^ry^s$. This shows the group is the internal direct sum of these two cyclic groups. As $\gcd(3,4)=1$  it is cyclic of order 12.
EDIT: After seeing the answer by Michael Albanese it clear that my answer is wrong. However I am keeping it so that it will be a lesson on how one  (that is me!)  can go wrong.
