Prove that $H_n=\{\sigma \in S_n \mid \sigma (i) \equiv i \pmod 3 \}$ with $n≥2$ is a subgroup of $S_n$. 
Prove that $H_n=\{\sigma \in S_n \mid \sigma (i) \equiv i \pmod 3 \}$ with $n≥2$ is a subgroup of $S_n$.

I'm doing this problem and I don't know if my approach is correctly done.

First of all, we see that $id\in H_n$, because $id(i)=i\equiv i\! \pmod 3$, and $H_n$ is not empty.
We have to see now that if $\sigma$, $\tau \in H_n$, then $\sigma\tau^{-1}\in H_n$.
First, we see that if $\tau \in H_n$, then $\tau (i) \equiv i$ (mod $3$). Furthermore, $\tau^{-1} (i) \equiv i \pmod 3$. So  $$\sigma\tau^{-1}(i)=\sigma(\tau^{-1}(i))=\sigma(i+3k)\equiv i+3k \!\!\!\pmod 3 \equiv i\!\!\! \pmod 3 \in H_n.$$
So $H_n$ is a subgroup of $S_n$.

I know that this is an easy exercise, but I'm having some troubles with the permutation groups, so I would like someone to say if I made any mistakes
Thank you.

This is not exactly a problem in modular arithmetic. Let $X$ be a set and $G$ be the group of all permutations of $X$. Take a partition of the set $X$,
say $X=\bigcup_j X_j$. Now the set of all permutations that preserve this partition is a subgroup of $G$: that is $\{\sigma\in G\mid \sigma(X_j)\subset X_j\forall j \}$ this is a subgroup (in fact isomorphic to the direct product of symmetric groups of degrees equal to the cardinalities of all these $X_j$'s.
In your case the partition is on the set $\{1,2,\ldots, n\}$ given by the residue classes modulo 3. Viewed this way you will see that this is not a problem in number theory.
