Prove that G is a group The exercise is:

Let $g\in G$. $G$ is a group. Prove that $G=\{gx:x\in G$}.

I know the the definition of group but the proof that is in the book is the next one:

Let $H=\{gx:x\in G\}$
$H\subseteq G$ because
$g\in G$ and $x\in G$ $\Rightarrow gx \in G$
G $\subseteq H$ (?)
(by definition) Let $x\in G$.
We want $x=gy$
$x=gy/\cdot g^{-1} \Leftrightarrow g^{-1}x=y$
$x=g(g^{-1}x)$
$y\in G$ : $g\in G \Rightarrow g^{-1} \in G$
so, $g^{-1}\in G$ and $x\in G$ $\Rightarrow g^{-1}x \in G \Rightarrow x\in H$

I don't understand what is the idea behind all this. What I see is that we made a subset that is same as superset and proved that they are the same. Can you please explain.
 A: The question is a set-up to Cayley's Theorem, which says roughly that every group can be thought of as a group of permutations. 
You're being asked to show that there's a bijection between the sets $G$ and $\{gx : x\in G\}$. You show that the set of elements that make up $G$ are exactly the same set of elements that make up $\{gx: x \in G\}$ (in this case, by showing each is a subset of the other). 

The motivation is that if we pick a group element $g \in G$ and left multiply every group element by $g$, this defines a permutation of the elements of $G$;  you're just jumbling up the group elements. We can formalize this by saying that there's a bijection
\begin{align*}
\ell_g\colon G &\to \{gx: x \in G\} = G \\
x &\mapsto gx,
\end{align*}
since permutations are just bijections between a set and itself. So you pick an element $g \in G$, and it determines a permutation of $G$, sending $x$ to $gx$. We get a permutation for every $g \in G$, and we say that $G$ acts on itself by left multiplication. 
That's why you'd be asked to prove something like this; by viewing the result the right way, you've essentially proven Cayley's Theorem.
A: The idea for the proof is that for $2$ sets $A,B$
$$
A=B\iff A\subset B \land B\subset A
$$
To prove $A\subset B$, use
$$
A\subset B\iff \forall x\in A\implies x\in B
$$
So to prove $G=H$, just prove $G\subset H$ and $H\subset G$.
To prove $G\subset H$, just prove that if $x\in G$ then $x\in H$.
