The Hamming distance satisfies the triangle inequality that is for all $x,y,u$ in $c$ such that $d(x,y) \le d(x,u) + d(u,y)$ where $c$ is a code. Also when does the equality hold?
My approach is: turn $x$ to $u$ by changing at most $d(x,u)$ letters and turn $u$ to $y$ by changing at most $d(u,y)$ letters. So turning $x$ to $t$ will change no more than $d(x,u) + d(u,y)$ letters.
By looking at the following example, $x = 001111, \ y = 111111, \ z = 011111$, the equality holds when changing $x$ to $y$, $z$ is just an intermediate step.
Does this make sense?