Let $f:\mathbb{Z}\_{p}\rightarrow\mathbb{C}$ be a function such that $\delta\_{a}f:\mathbb{Z}\_{p}\rightarrow\mathbb{C}$ is a locally constant function for any $a\in\mathbb{Z}\_{p}$, where $\delta\_{a}f(x):=f(x+a)-f(x)$. Does it necessarily imply that $f$ is locally constant?



Smooth function on $\mathbb{Z}_{p}$
No, $f$ does not have to be locally constant. Here is an example. Take a nonzero $\mathbb{Q}$-linear map $L \colon \mathbb{Q}\_p \to \mathbb{Q}$, and let $f = L|\_{\mathbb{Z}\_p}$. Then $\delta\_a f(x) = L(x+a)-L(x) = L(a)$, so $\delta\_a f$ is a constant function for every $a$. However $f$ is not locally constant: take a $z \in \mathbb{Z}\_p$ with $f(z) \neq 0$, then $|f(p^n z)| = p^n |f(z)| \to \infty$ in $\mathbb{C}$, while $p^n z \to 0$ in $\mathbb{Z}\_p$.


If we also assume that $f$ is continuous, then indeed $f$ has to be locally constant. Proof:
We can replace $f$ with $f-f(0)$, so let $f(0) = 0$.
For $n \in \mathbb{Z}\_{\ge 0}$ let us call a function $g \colon \mathbb{Z}\_p \to \mathbb{C}$ $n$-locally constant, if $g(x)=g(y)$ for every $x,y \in \mathbb{Z}\_p$ with $|x-y|\_p \le p^{-n}$. So $g$ is locally constant if and only if it is $n$-locally constant for some $n \ge 0$. Let $A\_n$ be the set of $a \in \mathbb{Z}\_p$ such that $\delta\_a f$ is $n$-locally constant.
Then $\bigcup\_{n \ge 0} A\_n = \mathbb{Z}\_p$, and each $A\_n$ is closed in $\mathbb{Z}\_p$, because
$$A\_n = \bigcap\_{x,y \in \mathbb{Z}\_p : \, |x-y| \le p^{-n}} \{a \in \mathbb{Z}\_p: \, f(x+a)-f(x) = f(y+a)-f(y) \}.$$
So by the Baire category theorem, there is an $n$ such that $A\_n$ contains an open ball $c + p^m \mathbb{Z}\_p$ for some $m \ge n$.
Then $f(x+c) = f(x)+f(c)$ for every $x \in p^m \mathbb{Z}\_p$, and $f(x+c+y) - f(x) = f(c+y) = f(y) + f(c)$ for every $x,y \in p^m \mathbb{Z}\_p$.
Using $f(x+y+c) = f(x+y)+f(c)$, we get that $f(x+y) = f(x) + f(y)$ for every $x,y \in p^m \mathbb{Z}\_p$.
So if $x \in p^m \mathbb{Z}\_p$, then $p^k f(x) = f(p^k x) \to f(0) = 0$ as $k \to \infty$, hence $f(x) = 0$.
It easily follows that $f$ is locally constant.


