Topological space that is not homeomorphic to the disjoint union of its connected components

Two standard examples of totally disconnected spaces (that are not discrete) are $\mathbb{Q}$ (with the subspace topology from $\mathbb{R}$) and the product $\{ 0, 1 \}^{\mathbb{N}}$ of countably many copies of the two-point discrete space (homemorphic to both the Cantor set and, if I recall correctly, the $p$-adic integers).

Generalizing the second example, any Stone space is totally disconnected. These spaces are important as they arise as the spectra of Boolean rings.

If you want to expand your repertoire of examples of spaces, it's hard to do better than Steen and Seebach's Counterexamples in Topology.