Let $A$ be a finite set, and $B$ a subset of $A$. Let $G$ be the subset of $S_A$ consisting of all the permutations $f$ of $A$ such that $f(x)\in B$ for every $x\in B$. Prove that $G$ is a subgroup of $S_A$.
Since $A$ is a finite set we only have to prove that $G$ is closed under the operation. But I am unsure of how to go about showing that. I know that I have to show that $g_1\circ g_2\in G$ for $g_1,g_2\in G$.