Connectedness formalizes the idea that a space has no separation into two open pieces. On the real line this recovers intervals and the intermediate value theorem.
Separations and connected spaces
A separation is a genuine topological split.
Definition. A topological space \(X\) is connected if it cannot be written as \(X=U\cup V\), where \(U,V\) are disjoint nonempty sets that are open in the relative topology of \(X\).
Proposition. A space \(X\) is connected if and only if the only subsets that are both open and closed are \(\varnothing\) and \(X\).
Proof. If \(A\) is nonempty, proper, open, and closed, then \(A\) and \(X\setminus A\) form a separation. Conversely, a separation \(X=U\cup V\) makes \(U\) both open and closed, nonempty and proper.
Proposition (union through a common core). If \(\{C_\alpha\}_{\alpha\in A}\) are connected subsets of \(X\) and \(\bigcap_\alpha C_\alpha\ne\varnothing\), then \(\bigcup_\alpha C_\alpha\) is connected. More generally, it is enough that every \(C_\alpha\) meet one fixed connected set \(C_0\).
Proof. Suppose the union is separated as \(U\cup V\). The connected core \(C_0\) lies entirely in one side, say \(U\). Every connected \(C_\alpha\) meets \(C_0\), hence meets \(U\); it cannot also meet \(V\), so \(C_\alpha\subset U\). Thus the union misses \(V\), contradicting that the separation is nontrivial.
Intervals are the connected subsets of the line
Order and connectedness coincide in \(\mathbb R\).
Theorem. A subset \(E\subset\mathbb R\) is connected if and only if it is an interval, meaning that \(x,z\in E\) and \(x\lt y\lt z\) imply \(y\in E\).
Proof. If \(E\) misses a point \(y\) between \(x,z\in E\), then \[ E\cap(-\infty,y)\quad\text{and}\quad E\cap(y,\infty) \] are disjoint, nonempty, relatively open, and cover \(E\), so \(E\) is disconnected.
Conversely, suppose an interval \(E\) is separated as \(U\cup V\). Choose \(u\in U\), \(v\in V\), relabeling so that \(u<v\), and put \[ s=\sup\bigl(U\cap[u,v]\bigr). \] Because \(E\) is an interval, \([u,v]\subset E\). If \(s\in U\), relative openness gives \(\eta>0\) with \((s-\eta,s+\eta)\cap E\subset U\); unless \(s=v\), this contradicts the definition of \(s\), while \(s=v\) contradicts \(v\in V\). If \(s\in V\), relative openness gives \(\eta>0\) with \((s-\eta,s+\eta)\cap E\subset V\), but the supremum property supplies \(t\in U\cap[u,v]\) with \(s-\eta<t\le s\), again a contradiction. Since \(s\in[u,v]\subset E=U\cup V\), the two cases exhaust the possibilities.
Continuous images and intermediate values
Continuous functions cannot tear connected sets apart.
Theorem. The continuous image of a connected set is connected. Hence if \(f:[a,b]\to\mathbb R\) is continuous and \(f(a)\lt y\lt f(b)\), then \(f(c)=y\) for some \(c\in(a,b)\).
Proof. If \(f(X)\) had a separation \(U\cup V\), then \(f^{-1}(U)\) and \(f^{-1}(V)\) would separate \(X\). The image \(f([a,b])\) is therefore a connected subset of \(\mathbb R\), hence an interval containing \(f(a)\) and \(f(b)\), so it contains \(y\).
Components
Components are maximal connected pieces.
Definition. The connected component of \(x\in X\) is the union of all connected subsets of \(X\) containing \(x\).
Proposition. Components are connected, closed, pairwise disjoint, and partition the space.
Proof. The union of connected sets with a common point is connected, giving connectedness and maximality. Distinct components cannot meet, because their union would then be connected. The closure of a connected set is connected, so maximality implies each component contains its closure.
Remark. Components need not be open. In the subspace \[ X=\{0\}\cup\{1/n:n\ge1\}\subset\mathbb R, \] every component is a singleton, but \(\{0\}\) is not open in \(X\). Components and path components in more general spaces are treated in General topology.
Path connectedness
Path connectedness is stronger than connectedness, though the two agree for intervals and many Euclidean domains.
Definition. A space is path connected if for every \(x,y\) there is a continuous map \(\gamma:[0,1]\to X\) with \(\gamma(0)=x\) and \(\gamma(1)=y\).
Proposition. Every path connected space is connected.
Proof. If \(X=U\cup V\) were a separation and \(x\in U,y\in V\), a path from \(x\) to \(y\) would have connected image in \(X\). That image would be split by \(U\) and \(V\), contradicting connectedness of \([0,1]\).
Example (connected but not path connected). The topologist's sine curve \[ S=\{(x,\sin(1/x)):0<x\le1\}\cup(\{0\}\times[-1,1]) \] is connected because the oscillating graph is the continuous image of the connected interval \((0,1]\), and its closure is connected. It is not path connected: a path from the vertical segment to the graph would force a continuous \(x\)-coordinate to approach \(0\) while \(\sin(1/x)\) acquires infinitely rapid oscillations, incompatible with continuity of the path's \(y\)-coordinate at the first time it leaves the vertical segment.