Let $x,y\in A \cup B$. Then either
- $x,y\in A$, which implies
$$d(x,y) \le \operatorname{diam}(A) \le \operatorname{diam}(A) + \operatorname{diam}(B) + d(A,B).$$
- $x\in A, y\in B$. Given $\epsilon > 0$, there exists $a\in A$ and $b\in B$ such that $d(a,b) < d(A,B) + \epsilon$. By the triangle inequality,
$$d(x,y) \le d(x,a) + d(a,b) + d(b,y) < \operatorname{diam}(A) + (d(A,B) + \epsilon) + \operatorname{diam}(B) .$$
Since $\epsilon$ was arbitrary, $$d(x,y) \le \operatorname{diam}(A) + \operatorname{diam}(B) + d(A,B).$$
$x\in B, y\in A$. Same reasoning as in $2$.
$x, y\in B$. Same reasoning as in $1$.
So in all cases, $d(x,y)$ is bounded above by $\operatorname{diam}(A) + \operatorname{diam}(B) + d(A,B)$. Since $x$ and $y$ were arbitrary, $\operatorname{diam}(A) + \operatorname{diam}(B) + d(A,B)$ is an upper bound for the set $\{d(x,y): x,y\in A\cup B\}$. Therefore
$$\operatorname{diam}(A\cup B) \le \operatorname{diam}(A) + \operatorname{diam}(B) + d(A,B).$$