Some sets are connected and some are not. The term means roughly that the set is in one “one piece”. The concept is a little tricky because it is defined in terms of not being something else. First we give another definition.
Definition 6.5.1 Let S be a set. Then , called the closure of S consists of S ∪ S^{′} where S^{′} denotes the set of limit points of S.
Note that it is obvious from the above definition that if S ⊆ T, then ⊆ .
Definition 6.5.2 A set S is said to be separated if it is of the form

A set S is connected if it is not separated.
Example 6.5.3 Consider S = [0,1) ∪ (1,2]. This is separated. Therefore, it is not connected.
To see this, note that [0,1) =
One of the most important theorems about connected sets is the following.
Theorem 6.5.4 Suppose U and V are connected sets having nonempty intersection. Then U ∪ V is also connected.
Proof: Suppose U ∪ V = A ∪ B where A ∩ B = B ∩ A = ∅. Consider the sets A ∩ U and B ∩ U. Since

It follows one of these sets must be empty since otherwise, U would be separated. It follows that U is contained in either A or B. Similarly, V must be contained in either A or B. Since U and V have nonempty intersection, it follows that both V and U are contained in one of the sets A,B. Therefore, the other must be empty and this shows U ∪V cannot be separated and is therefore, connected. ■
How do connected sets relate to continuous real valued functions?
Proof: To do this you show f
On ℝ the connected sets are pretty easy to describe. A set, I is an interval in ℝ if and only if whenever x,y ∈ I then
Proof: Let C be connected. If C consists of a single point p, there is nothing to prove. The interval is just

let C ∩
Conversely, let I be an interval. Suppose I is separated by A and B. Pick x ∈ A and y ∈ B. Suppose without loss of generality that x < y. Now define the set,

and let l be the least upper bound of S. Then l ∈A so l

contradicting the definition of l as an upper bound for S. Therefore, l ∈B which implies l
Another useful idea is that of connected components. An arbitrary set can be written as a union of maximal connected sets called connected components. This is the concept of the next definition.
Definition 6.5.7 Let S be a set and let p ∈ S. Denote by C_{p} the union of all connected subsets of S which contain p. This is called the connected component determined by p.
Theorem 6.5.8 Let C_{p} be a connected component of a set S. Then C_{p} is a connected set and if C_{p} ∩ C_{q}≠∅, then C_{p} = C_{q}.
Proof: Let C denote the connected subsets of S which contain p. If C_{p} = A ∪ B where

then p is in one of A or B. Suppose without loss of generality p ∈ A. Then every set of C must also be contained in A since otherwise, as in Theorem 6.5.4, the set would be separated. But this implies B is empty. Therefore, C_{p} is connected. From this, and Theorem 6.5.4, the second assertion of the theorem is proved.■
This shows the connected components of a set are equivalence classes and partition the set.
Probably the most useful application of this is to the case where you have an open set and consider its connected components.
Theorem 6.5.9 Let U be an open set on ℝ. Then each connected component is open. Thus U is a countable union of disjoint open intervals.
Proof: Let C be a connected component of U. Let x ∈ C. Since U is open, there exists δ > 0 such that

Hence this open interval is also contained in C because it is connected and shares a point with C which equals the union of all connected sets containing x. Thus each component is both open and connected and is therefore, an open interval. Each of these disjoint open intervals contains a rational number. Therefore, there are countably many of them. ■
To emphasize what the above theorem shows, it states that every open set in ℝ is the countable union of open intervals. It is really nice to be able to say this.