Let $\mathbb{Q}_p$ denote the p-adic rationals and same for the integers. Suppose $f:\mathbb{Z}_p\to\mathbb{Q}_p$ is continuous, with the additional property that at $n\in\mathbb{Z}^{\geq 0}$, $f(n)=(-1)^n$.
I wish to conclude that $p=2$.
I'm a little stuck with how to proceed. By way of contradiction, suppose that $p>2$. By continuity, we must have that for all $x,y\in\mathbb{Z}_p$, $$|f(x)-f(y)|_p<\epsilon$$ if $x,y$ is sufficiently close (the definition of continuity).
Now, I'd like to choose integers which are close but such that $(-1)^n$ and $(-1)^{n'}$ are opposites, and then somehow use this to derive a contradiction, but I'm stuck making a rigorous argument. Perhaps I'm thinking about $p$ adic continuity wrong?
In $\mathbf Z_p$, $p^k\to 0$ as $k \to \infty$, so in $\mathbf Q_p$ we need $(-1)^{p^k} \to (-1)^0 = 1$ as $k \to \infty$. For $p \not= 2$, $(-1)^{p^k} = -1$ for all $k \geq 1$ so $p$ can't be odd. Thus $p$ must be $2$.
If you don't want to work with $f(0)$ being known, but only $f(n)$ for $n \geq 1$, then use $p^k + 1 \to 1$ to get $(-1)^{p^k + 1} \to (-1)^1 = -1$ as $k \to \infty$. Again, for $p \not= 2$ we have $(-1)^{p^k + 1} = 1$ for $k \geq 1$, and thus $p$ must be $2$.
Neither of those arguments shows $(-1)^n$ actually is $2$-adically continuous, but that is immediate from it being $2$-adically locally constant: it's $1$ for $n \in 2\mathbf Z$ and $-1$ for $n \in 1 + 2\mathbf Z$.