TITLE: Need example for a topological space that isn't connected, but is compact
QUESTION [4 upvotes]: We know the topological space $(R,τ_1)$ is a connected space but it is not compact, $(R,τ_+)$ (which generated by $[a,b[$) is not connected space and it is not compact space, and $(R,τ_{cf})$ is connected and compact space.
Can someone give me an example of a compact space that isn't connected?

REPLY [0 votes]: Take any two compact, connected topological spaces $X,Y$. Define their discrete union to be the disjoint union $X \coprod Y = (X \times \{0\}) \cup (Y \times \{1\})$ with the topology generated by all sets of the form $U \times \{0\}$ or $V \times \{1\}$ where $U \subset X$ is any open set in $X$ and $V \subset Y$ is any open subset of $Y$. Then $X \coprod Y$ is compact and has two components, one being $X \times \{0\}$ and the other $Y \times \{1\}$.
{"set_name": "stack_exchange", "score": 4, "question_id": 1043409}