Hello,
I am having trouble understanding groups in my group theory class. I am not confident on how to approach the following question:
Let D = D_{8} be dihedral of order 8 so
D = {u,y,y^{2},y^{3},x,xy,xy^{2},xy^{3}}
where x^{2} = u, y^{4} = u, and yx = xy^{1}.
Let g = xy^{i} for some integer i. Prove that g^{2} = u.

I know that y
^{4} = u. So then,
g = xy
^{4} = xu = x. Then
g
^{2} = x
^{2} = u
which is what I am trying to prove.
Now if i = 1 then,
g = xy. Then
g
^{2} = xy xy = x yx y = x xy
^{1} y. Then
xx y
^{1}y = x
^{2} y
^{1}y = u y
^{1}y since
x
^{2} = 2. Then
u y
^{1}y = u u = u since
y
^{1}y = u.
First question: Is the work I have completed so far correct?
Second question: Do I need to prove this in a case by case basis? That is, I would think that I would have to prove this for i = 1,2,3,4. Since I have already completed 1 and 4, I would have to do cases in which i = 2,3. Correct?
This may seem elementry, but like I stated above, my confidence in answering such questions is not great. And my understanding of the material is very weak.
Any comments, input, help is appreciated.
Thankyou.