I have a set $S$ and two one-to-one functions $f:S \to S$ and $g: S \to S$ such that for all $s \in S$ we have $f(g(s))=g(s)$ and $g(f(s))=f(s)$.
If $S$ is infinite, does it follow that $f(f(s))=f(s)$ and $g(g(s))=g(s)$?
If $S$ is finite, then $f$ and $g$ are bijective, so, for instance, $f(f(g(t))=f(g(t))$ follows from the properties and each $s=g(t)$ for some $t$.
But if $S$ is infinite we don't necessarily have a bijection. A concrete counterexample would be nice, if it exists.
Yes. Start with $$ g(f(s)) = f(s) $$ use $$ g(s) = f(g(s)) $$ to substitute the outer $g(s)$ on the LHS. $$ f(g(f(s))) = f(s) $$ Then use $$ g(f(s)) = f(s) $$ to substitute the inner $g(f(s))$. $$ f(f(s)) = f(s) $$ You can do the same with $g$.