The question is like this:
IF $G=S_5$ and $g=(1\quad 2\quad 3)$, determine the number of elements in $H=\{x\in G:xg=gx\}$.
To do the question, first it says $$x(4)=(x(1\quad 2\quad 3))(4)=(1\quad 2\quad 3)x(4)$$ so $g(4)=4\ or\ 5$. Similarly, $g(5)=4\ or\ 5$.
Hence $g(\{4,5\})=\{4,5\}$ and also $g(\{1,2,3\})=\{1,2,3\}$.
My understanding for this part is that this is because the permutation $(1\quad 2\quad 3)$ has nothing to do on 4 or 5. Is this correct ?
But then it says this means $x$ must be one of the following: $$id,\ (1\quad 2\quad 3),\ (1\quad 3\quad 2),\ (4\quad 5),\ (1\quad 2\quad 3)(4\quad 5),\ (1\quad 3\quad 2)(4\quad 5)$$ I'm wondering how these are found? How do we find those $x$ satisfying $xg=gx$?
For example, what if I change the question as $G=S_6$ and $g=(1\quad 2\quad 3\quad 4)$ or $g=(1\quad 2\quad 3)$?
And how can we determine if two permutations commute without actual calculation?