I am aware that the statement:
$$f(x)=f(\sin(\pi x)+x)\iff x\in\Bbb{Z}$$
is not true for all $f$. For example, $f$ can be $x$ to any constant power or any constant to the $x$th power but it cannot be the gamma function $\Gamma(x)$ or $\sin(x)$ or $x^x$. I have been told that it is important to note whether or not $f$ is injective. However, $f(x)=x^2$ is not injective, yet it satisfies the statement. If being injective is only a *sufficient* condition as opposed to a *necessary* condition, what exactly do we know about the class of functions that makes this statement true?

Thanks in advance!