Stated informally, connected sets are those which are in one piece. More precisely,
Definition 6.9.1 A set, S in a general topological space is separated if there exist sets, A,B such that

In this case, the sets A and B are said to separate S. A set is connected if it is not separated.
One of the most important theorems about connected sets is the following.
Theorem 6.9.2 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.
The intersection of connected sets is not necessarily connected as is shown by the following picture.
Theorem 6.9.3 Let f : X → Y be continuous where X and Y are topological spaces and X is connected. Then f
Proof: To do this you show f
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.9.4 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.9.5 Let C_{p} be a connected component of a set S in a general topological space. 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 also since otherwise, as in Theorem 6.9.2, the set would be separated. But this implies B is empty. Therefore, C_{p} is connected. From this, and Theorem 6.9.2, the second assertion of the theorem is proved.
This shows the connected components of a set are equivalence classes and partition the set.
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
The following theorem is a very useful description of the open sets in ℝ.
Theorem 6.9.7 Let U be an open set in ℝ. Then there exist countably many disjoint open sets,
Proof: Let p ∈ U and let z ∈ C_{p}, the connected component determined by p. Since U is open, there exists, δ > 0 such that

This shows C_{p} is open. By Theorem 6.9.6, this shows C_{p} is an open interval,
Definition 6.9.8 A topological space, E is arcwise connected if for any two points, p,q ∈ E, there exists a closed interval,
An example of an arcwise connected topological space would be the any subset of ℝ^{n} which is the continuous image of an interval. Locally connected is not the same as connected. A well known example is the following.
 (6.9.14) 
You can verify that this set of points considered as a metric space with the metric from ℝ^{2} is not locally connected or arcwise connected but is connected.
Proof: Let X be an arcwise connected space and suppose it is separated. Then X = A ∪ B where A,B are two separated sets. Pick p ∈ A and q ∈ B. Since X is given to be arcwise connected, there must exist a continuous function γ :
Theorem 6.9.10 Let U be an open subset of a locally arcwise connected topological space, X. Then U is arcwise connected if and only if U if connected. Also the connected components of an open set in such a space are open sets, hence arcwise connected.
Proof: By Proposition 6.9.9 it is only necessary to verify that if U is connected and open in the context of this theorem, then U is arcwise connected. Pick p ∈ U. Say x ∈ U satisfies P if there exists a continuous function, γ :

If x ∈ A, there exists, according to the assumption that X is locally arcwise connected, an open set, V, containing x and contained in U which is arcwise connected. Thus letting y ∈ V, there exist intervals,

Then it is clear that γ_{1} is a continuous function mapping p to y and showing that V ⊆ A. Therefore, A is open. A≠∅ because there is an open set, V containing p which is contained in U and is arcwise connected.
Now consider B ≡ U ∖ A. This is also open. If B is not open, there exists a point z ∈ B such that every open set containing z is not contained in B. Therefore, letting V be one of the basic open sets chosen such that z ∈ V ⊆ U, there exist points of A contained in V. But then, a repeat of the above argument shows z ∈ A also. Hence B is open and so if B≠∅, then U = B ∪ A and so U is separated by the two sets, B and A contradicting the assumption that U is connected.
It remains to verify the connected components are open. Let z ∈ C_{p} where C_{p} is the connected component determined by p. Then picking V an arcwise connected open set which contains z and is contained in U, C_{p} ∪ V is connected and contained in U and so it must also be contained in C_{p}. This proves the theorem.
As an application, consider the following corollary.
Corollary 6.9.11 Let f : Ω → ℤ be continuous where Ω is a connected open set. Then f must be a constant.
Proof: Suppose not. Then it achieves two different values, k and l≠k. Then Ω = f^{−1}

which is the inverse image of an open set.