I’m teaching a course in discrete mathematics and was exploring (purely for my own interest) whether there were any functions $f : \mathbb{Z} \to \mathbb{Z}$ such that $f(f(n)) = n + 1$. I then started thinking about a more general discrete version of problems like these: given some function $g : A \to A$ for a countable (or finite) set $A$, determine whether there are any functions $f : A \to A$ where $f \circ f = g$.
In reading up on this style of problem, I came across some earlier questions (1, 2, etc.) that talked about fractional iteration over real-valued and complex-valued functions. However, those techniques seem specific to continuous-values functions rather than discrete ones. And from what I’ve read these techniques were partially developed as ways to find continuous functions generalizing discrete ones (say, tetration). However, I’m simply looking for ways to find discrete-valued functions that compose to some target, which seems like it ought to be a different problem.
Is there a name for this style of problem in the discrete case, and are there any techniques known for solving this sort of problem? (And, in particular, does my original $n + 1$ case have a solution?