Given
$f:\mathbb{Z}_p \to \mathbb{Q}_p $ such that
$$ f(x)= \begin{cases} 0, & \text{if } x=0 \\ 1/ |x|_p & \text{if } x\neq0\\ \end{cases} $$
How do I show that f is continuous and locally constant on $\mathbb{Z}_p$?
I'm planning to show that f is locally constant first so that it would just imply that it is also continuous. But I'm having a hard time choosing what particular radius I should put so that the function is constant on that open ball.
Any help would be great! :) I really need to understand this for my potential undergraduate thesis topic. :)
I would restate your definition of $f$ slightly, because most properly, $|x|_p$ is not a $p$-adic number but a real number. I would rather define your function as $f(x)=p^{v_p(x)}$, where $v_p:\Bbb Q_p\to\Bbb Z\cup\{+\infty\}$, in other words, $v_p(x)=-\log_p(|x|_p)$, so that $v_p(p)=1$, $v_p(xy)=v_p(x)+v_p(y)$, and $v_p(n)=0$ if $n$ is an integer prime to $p$.
To prove that $f$ was locally constant, I would take $0\ne z\in\Bbb Z_p$, say $v(z)=r\ge0$. Then on the set $\{x\in\Bbb Z_p:v_p(x-z)>r\}$, the function is constant. In the language of absolute values, if $|z|=p^{-r}$, then the function is constant on the “ball” centered at $z$ of radius $p^{-r-1}$. Of course you use the nonarchimedean property to show this.
For continuity at $0$, the only point where things are questionable: take a sequence of points $\{z_m\}$ going to zero, then you see at a glance that $v(z_m)\to\infty$, so that $p^{v(z_m)}\to0$, and all’s right with the world.