Let $H = \{g \in S_6 : g(a)\equiv a\pmod3 \text{ for } a\in\{1,2,3,4,5,6\}\}.$ Is this a subgroup? Let $H = \{g \in S_6 : g(a)\equiv a\pmod3 \text{ for } a\in\{1,2,3,4,5,6\}\}.$ Is this a subgroup?
The identity element $\in H$ because for all $a \in \{1,2,3,4,5,6\}$, we have $h(a) ≡ a\pmod3$ as $h(a)-a=a-a = 0$ and $3|0$.
For closure, let $g,h \in H$. Then for all $a \in \{1,2,3,4,5,6\}$, we have $g(a)\equiv a\equiv h(a)\pmod3$. So for all $a \in \{1,2,3,4,5,6\}$, $(gh)(a)=g(h(a))$. Now this is where I am unsure how to proceed!!
I try for inverses anyway. Let $h \in H$. Then $h(a)\equiv a\pmod3$, so $h^{-1}(h(a))=\ldots$
Can I have some help please ?
 A: Hint.
Try to prove that
$$H=\langle(14),(25),(36)\rangle\tag1$$
In general, the following statement is true.

Let $n$ and $m$ be positive integers and $X=\{1,2,\ldots,n\}$. If
$H=\{g\in S_n\mid g(a)\equiv a\pmod m\forall a\in X \}$, then $H$ is a
subgroup in $S_n$.

Proof.
Let $X_i=\{a\in X\mid a\equiv i\pmod m\}$, $i=0,1,\ldots,m-1$.
Now the set $H$ can be described by another $H=\{g\in S_n\mid g(X_i)=X_i\}$.
It seems obvious to me now that $H$ is a subgroup.
PS. If $n=6$, $m=3$, then $X_0=\{3,6\}$, $X_1=\{1,4\}$, $X_2=\{2,5\}$.
In this case $H$ is defined by the formula $(1)$.
A: Use the finite subgroup test.
You have $e\in H$, so $H\neq \varnothing$.
By definition, $H\subseteq S_6$.
For closure, suppose $g,h\in H$. Then for all $a\in \{1,2,3,4,5,6\}$, we have $\color{blue}{g(a)\equiv 
 a}\pmod{3}$ and $\color{red}{h(a)\equiv a}\pmod{3}$. Now
$$\begin{align}
(gh)(a)&=g(\color{red}{h(a)})\\
&\equiv g(\color{red}{a}\pmod{3})\\
&\equiv\color{blue}{g(a}\pmod{3}\color{blue})\\
&\equiv\color{blue}{a}\pmod{3},
\end{align}$$
so that $gh\in H$.
Hence $H$ is a subgroup of $S_6$
A: For finding the inverse, note that for all $a \in \{1,2,3,4,5,6\}$, $h(a) \equiv a \pmod{3}$. This means that $a - h(a)$ is divisible by $3$. Since $h^{-1}$ is also in $H$, $h^{-1}(h(a)) \equiv a \pmod{3}$. This implies that $h^{-1}(h(a)) - a$ is divisible by $3$. This means that $h^{-1}(h(a)) = a + 3k$ for some integer $k$. Thus, $h^{-1} \in H$ and $H$ is a subgroup.
