$f$ is defined to be a pseudo-constant function if $f'(x)=0$.
The question simply comes from idly wondering, "What are p-adic idempotent functions like?" Differentiable idempotent functions satisfy $f(f(x))=f(x)$ as well as its derivative $f'(f(x))f'(x)=f'(x)$.
If $f'(x)$ is nonzero for all $x$, then we have $f'(f(x))=1$ which is to be expected since if the image of $f$ is $A$, then for all $a \in A$ we have $f(a)=a$ is the identity function.
If $f'(x)=0$ for all $x$, then we have a pseudo-constant function. We can create a pseudo-constant idempotent function by partitioning $\mathbb{Z}_p$ into disjoint balls, each with a distinguished center, and create a locally constant function that maps a point in each of these balls to their center.
This last example can at most produce a pseudo-constant function with a countable image, since $\mathbb{Z}_p$ only has countably many distinct balls in its topology. On the other hand, I am aware of pseudo-constant functions with uncountably large images, but I see no reason why there couldn't also be idempotent ones.
The image $I$ of a pseudo-constant, idempotent $f:\mathbb Z_p \rightarrow \mathbb Z_p$ is, in fact, finite.
Namely, for all $x,y \in I$, $\frac{f(x)-f(y)}{x-y} =1$, so for $f' \equiv 0$ it is necessary that for every $x \in I$ there is $\varepsilon_x >0$ with $B_{\varepsilon_x} (x) \cap I = \{x\}$. The collection of all $B_{\varepsilon_x} (x)$ ($x\in I$) is an open cover of $I$.
But as pseudo-constant maps are continuous, $I$ is compact.