Let $f: \mathbb Z\to \mathbb Z$ be an arbitrary function. We can extend it to a function $f_p: \mathbb Z_p \to \mathbb Z_p $ if and only if $f(n) \to f(m) \in \mathbb Z_p$ as $n \to m \in \mathbb Z_p$. ($\mathbb Z_p$ denotes the p-adics).
Now, it is not hard to show that if $f$ arises from a linear recurrence relation, that is, it satisfies $$\sum_{k=0}^ma_kf(n+k) = 0 \text{ for all } n\gg 0$$ then, we can extend it to a function $f_p: \mathbb Z_p \to \mathbb Z_p$ for all primes $p$. This is because we can write $f(n) = \sum_\alpha c_\alpha\alpha^np_\alpha(n)$ for constants $c_\alpha,\alpha \in \overline{\mathbb Z}$ and polynomials $p_\alpha(n) \in \mathbb Z[n]$.
So we only need to check for $f(n) = \alpha^n, p(n)$ and that's easy enough.
Question: Are linear recurrences the only sequences for which we can extend it to the p-adics for every prime? Note that we only care about the eventual behavious of the sequences so we can modify as many initial terms as we want.