Choose \(\displaystyle x_0\in \mathcal{M}\). If it is an isolated point then \(\displaystyle \{x_0\}\) is open and closed, so \(\displaystyle \mathcal{M}\) is not connected. Otherwise, let \(\displaystyle D = \{d(x,x_0):x\in\mathcal{M},\;x\ne x_0\}\). Then D is a countable set of positive real numbers, with \(\displaystyle \inf D = 0\). It may happen that D is not bounded above, in which case define \(\displaystyle \sup D = \infty.\) In any case, we can find a real number \(\displaystyle r\notin D\) with \(\displaystyle 0<r<\sup D.\) Let \(\displaystyle U = \{x\in\mathcal{M}:d(x,x_0)<r\}\), \(\displaystyle V = \{x\in\mathcal{M}:d(x,x_0)>r\}\). Then \(\displaystyle U,\;V\) are disjoint nonempty open subsets of \(\displaystyle \mathcal{M}\) with \(\displaystyle U\cup V =\mathcal{M}\). So \(\displaystyle \mathcal{M}\) cannot be connected.

It is essential for that argument that \(\displaystyle \mathcal{M}\) should be a metric space.

This example shows that a countable Hausdorff topological space can be connected.