Constructing a sequence of points in a subset $X$ of a connected, compact, metrizable space that begins and ends at points of $X$ at maximal distance The problem I have is that. Suppose $X$ is a closed and connected subset of a compact metrizable space $M$ that has positive diameter $D=\operatorname{diam}(X)$. Let $x,y\in X$ such that $D=d(x,y)$.
I want to prove that given a positive number $\delta$ such that $0<\delta<D$ it is possible to construct a finite sequence of points of $X$,  $(x_i)$ such that

*

*$x_0=x$

*$x_m=y$ (for some positive integer $m$)

*$d(x_i, x_{i+1})<\delta$ for $i=0,\ldots,m-1$.

At first sight it seemed to me an easy task, but I am not being able to prove it.
 A: $(X,d)$ is a connected metric subspace of $M$. Consider any  $x,y\in X$  with $x\ne y$ and any $\delta$ such that $0<\delta<d(x,y).$ Let $S$ be the set of all finite sequences $(x_j)_{0\le j\le m}$of members of $X$, of any finite length, with $x_0=x,$ such that $d(x_j,x_{j+1})<\delta$ whenever $0\le j<m.$ Let $T\subset X$ where $t\in T$ iff there exists  $(x_j)_{0\le j\le m}\in S$ with $x_m=t.$
(i). $T\ne \emptyset$ because the 1-term sequence $(x)\in S$ shows that $x\in T.$
(ii). $T$ is open in $X$: If $u\in T,$ let $(x_j)_{0\le j\le m}\in S$ with $x_m =u.$ For any $t\in X\cap B_d(u,\delta),$ if $x_{m+1}=t$ then $(x_j)_{0\le j\le m+1}\in S$, so $t=x_{m+1}\in T.$
(iii). $T$ is closed in $X$: If $t\in X\cap\overline T,$ take $w\in T$ with $d(t,w)<\delta.$ There exists $(x_j)_{0\le j\le m}\in S$ with $x_m=w.$ So if $x_{m+1}=t$ then $(x_j)_{0\le j\le m+1}\in S$, so $t=x_{m+1}\in T.$
From (i),(ii),(iii), since $X$ is connected we have $T=X.$ So $y\in T$.
Note that compactness of $M$ was not used, nor the closedness of $X$ in $M$, although they were needed in the Q, but only to know that $D$ exists, and that there exists a pair $x,y\in X$ with $d(x,y)=D$.
