Solution 1:

Note. If $z = \pm \sum_{j=0}^N a_j p^j$, then $k$ is the first $a_k\ne 0$ if and only if $k$ is the highest power of $p$ so that $p|z$.

Keeping that in mind. If $k$ is the highest power that divides $x-y$ and $j$ is the highest power that divides $y-z$. If $k \ne j$ and $\min(k,j) < m \le \max(k,j)$ then $p^{m}$ will divide one of $x-y$ or $y-z$ but not the other so $p^m|(x-y)+(y-z) = x-z$.

In that case the highest power that divides $x-z$ is $\min(k,j)$ and $|x-z| = p^{-\min(k,j)}= \max(p^{-k},p^{-j}) = \max(|x-y|_p, |y-z|_p)$.

If on the other hand if $k = j$ then the maximum power that divides $(x-y)+(y-z)=x-z$ is $\ge k = j$ and $|x-z| \le |x-y|_p = |y-z|_p$ so

So $d(x,z) \le \max(d(x,y), d(y,z))$ and thus

$d(x,z) \le \max(d(x,y),d(y,z)) + \min(d(x,y), d(y,z)) = d(x,y) + d(y,z)$.

So that proves the triangle inequality.

And it proves b).

(It's okay to use b) to prove a) but.....)

Solution 2:

First observation is that $|z|_p = p^{-k}$ $\iff$ $k$ is the highest power of $p$ such that $p^k | z$.

Second observation is that if $p^k | z$ then $p^n | z$ for all $0 \leq n \leq k$.

Now consider $x, y, z \in \mathbb{Z}$. Let $|x - y|_p = p^{-k}$ and $|y - z|_p = p^{-j}$. Then, let $m = \min(k, j)$ so that $p^m | (x - y)$ and $p^m | (y - z)$ $\implies $ $p^m | (x - z)$ because $x - z = (x - y) + (y - z)$.

Hence, the highest power of $p$, call it $l$, such that $p^l | (x - z)$ satisfies $l \geq \min(k, j)$. Hence, \begin{align*} |x - z|_p = p^{-l} &\leq p^{-\min(k, j)} \\ &= \max(p^{-k}, p^{-j})\\ &= \max(|x - y|_p, \max(|y - z|_p))\\ &\leq |x - y|_p + |y - z|_p \end{align*}