A good period-2 function is
S={a1, a2, ..., ak} -> f(S)={n+1 - a1, n+1 - a2, ..., n+1 - ak}(that is, associate to S the set obtained by subtracting from n+1 the elements of S).
This operation maps X into itself, and has period two!
Q: Can you describe these sets?
[It makes a difference whether n is odd or even! You can try to
experiment with small values of n.]
In one of the cases, there are many such sets.
Try again to form pairs! One of them has no pair, so the total number of
elements was odd.