I was wondering if there exists non-polynomial functions $f : \mathbb{Z} \longrightarrow \mathbb{Z}$ such that $f(k) \equiv f(k+n) \hspace{1mm}(\text{mod } n)$ for every integer $k$ and integer $n \geq 2$.
My reason for asking this was because polynomials in $\mathbb{Z}[x]$ or integer valued polynomials in $\mathbb{Q}[x]$ obviously satisfy above. However, I do not seem to know of any other function that does the same. I was wondering if anyone could provide some examples and/or whether such things have been studied before.