Let $H = \{g \in S_5 : g(2) = 2\text{ and }g(4)=4\}$.
Is this a subgroup ? I know the identity element $\in H$ as this is $(1)(2)(3)(4)(5)$ which satisfies the requirements of the original group.
For closure, let $g,h \in S_5$. Then $g(2)=2=h(2)$ and $g(4)=4=h(4)$, so $(gh)(2)=g(h)(2)=g(2) = 2$ and $(gh)(4)=g(h)(4)=g(4) = 4$. Thus, $gh \in H$.
Finally, for inverses, let $h \in H$. Then $h(2) = 2$, so $h^{-1}(h(2))=h^{-1}(2)$ and so $h^{-1}(2)=2$. Thus, $h^{-1}\in H$. Let $h \in H$. Then $h(4) = 4$, so $h^{-1}(h(4))=h^{-1}(4)$ and so $h^{-1}(4)=4$. Thus, $h^{-1}\in H$.
Thus, $H$ is a subgroup of $S_5$. I am confident my first requirement is correctly satisfied but I think I did $2$ and $3$ incorrectly. Can someone help me out ? Cheers.
Your proof is fine.
Nitpicking:
You need to specify which group it is a subgroup of. From the context, I'm guessing it's $S_5$.
You need to prove that $H\subseteq S_5$. This is simple enough; it follows from the definition of $H$.
For closure, you need to start with $g,h\in H$.