[guided]Assume that $f:X \to X$ satisfies the pointwise estimate
\begin{align*}
d(f(x),f(y)) \le c\,d(x,y)
\end{align*}
for every $x,y \in X$. We want to prove that the same constant controls the diameter of the image of an arbitrary nonempty subset. Fix a nonempty subset $A \subset X$.
The delicate case is $c=0$, because the statement has explicitly chosen the convention $0\cdot\infty=0$. Under the hypothesis with $c=0$, for every $x,y \in A$ we have
\begin{align*}
d(f(x),f(y)) \le 0.
\end{align*}
A metric takes values in $[0,\infty)$, so the same quantity also satisfies $0 \le d(f(x),f(y))$. Hence
\begin{align*}
d(f(x),f(y))=0
\end{align*}
for all $x,y \in A$. Thus all pairwise distances inside $f(A)$ are equal to $0$, and the supremum of those distances is
\begin{align*}
\operatorname{diam}(f(A))=0.
\end{align*}
The convention in the theorem says that $0\cdot\operatorname{diam}(A)=0$ even if $\operatorname{diam}(A)=\infty$. Therefore
\begin{align*}
\operatorname{diam}(f(A)) \le 0\cdot\operatorname{diam}(A).
\end{align*}
It remains to handle $0<c<1$. For any two points $x,y \in A$, the number $d(x,y)$ belongs to the set whose extended supremum defines $\operatorname{diam}(A)$. Therefore
\begin{align*}
d(x,y) \le \operatorname{diam}(A).
\end{align*}
Because $c>0$, multiplying by $c$ preserves the order in the extended nonnegative real line, with the convention $c\infty=\infty$. Thus
\begin{align*}
c\,d(x,y) \le c\,\operatorname{diam}(A).
\end{align*}
Combining this inequality with the contraction estimate gives
\begin{align*}
d(f(x),f(y)) \le c\,\operatorname{diam}(A).
\end{align*}
This holds for every pair $x,y \in A$. Since the points of $f(A)$ are exactly the points $f(x)$ with $x \in A$, the displayed inequality bounds every pairwise distance occurring in $f(A)$. Taking the extended supremum of those pairwise distances gives
\begin{align*}
\operatorname{diam}(f(A)) \le c\,\operatorname{diam}(A).
\end{align*}[/guided]