In showing that the diameter of a compact set $A$ is attainable, one approach is to consider a function $f:A\times A\rightarrow\mathbb{R}$ such that $f(x,y)=d(x,y)$. The key is to show that the function $f$ is continuous on $A$.
I proved the continuity by using the definition: that for $\delta=\epsilon$, if $d(a_1,b_1)+d(a_2,b_2)<\delta$, then $|d(a_1,a_2)-d(b_1,b_2)|<\epsilon$.
This follows from repeated applications of the triangle inequality: $d(a_1,a_2)-d(b_1,b_2)<(d(a_1,b_1)+d(b_1,a_2))-(d(b_1,a_2)-d(a_2,b_2)) = d(a_1,b_1)+d(a_2,b_2)<\epsilon$. Similarly, $d(b_1,b_2)-d(a_1,a_2)<\epsilon$, and hence $|d(a_1,a_2)-d(b_1,b_2)|<\epsilon$.
Are there other ways to see that $f$ is continuous? (I was hoping there's perhaps a simpler way...)