Solution (source code)

= Solution

The final property concerns a <pointwise periodic self-map>. Such a <map> is a <bijection>: each point has a predecessor in its finite cycle, giving surjectivity; if $f(x)=f(y)$, choose a common multiple $N$ of periods of $x,y$ and apply $f^{N-1}$ to get $x=y$. Its finite cycles are therefore disjoint.

If $X$ is finite, choose the <least common multiple> of the finitely many cycle lengths. This positive <integer> $N$ gives $f^N=\operatorname{id}_X$. The empty <set> satisfies the property with $N=1$.

Conversely, in the usual <set> theory with choice, every infinite $X$ contains a <countably infinite set>. Divide such a subset into disjoint finite blocks $B_j$ of sizes $j+1$, $j\geq1$, make $f$ a cyclic permutation on each block, and fix every other point. Every point returns to itself, but an identity iterate would have to be divisible by every block length $j+1$. No positive <integer> has that property: take a block longer than that <integer>. Thus the <uniform period criterion for pointwise periodic maps> gives
$$
\boxed{X\text{ has the property exactly when }X\text{ is finite}.}
$$
The <axiom of choice> assumption is stated here because extracting a countably infinite subset of an arbitrary infinite <set> is not an unrestricted theorem in <set> theory without choice.