H is closed in S7 (under the operation of composition) because if you take h1 and h2 in H, h1h2(2) = h1(2) = 2, and similarly, h1h2(5) = h1(5) = 5. So h1h2 is in H.
Obviously the identity element (the permutation that fixes everything) is in H, and this also shows it's nonempty.
And the inverse of every h in H is also in H, because if h1 fixes 2 and 5, then its inverse fixes them as well.. If not, then the h1 composed with its inverse wouldn't give the identity back.
That should be enough to prove it's a subgroup.