TITLE: Infinite connected graph
QUESTION [8 upvotes]: Does an infinite connected graph mean that given any two vertices there is a path of finite length joining them or the path may be of infinite length?

REPLY [9 votes]: Diestel's Graph Theory deals with infinite graphs in chapter 8. He also considers certain infinite paths, namely the ray (indexed by $\mathbb{N}$) and the double ray (indexed by $\mathbb{Z}$). A path in an infinite graph may be either a finite path, a ray or a double ray. However, out of these options the finite path is the only one with two endpoints. Thus, when dealing with connectivity, indeed it is required that any pair of vertices can be joined by a finite path.
You can also approach the definition of connected components from another perspective. Let us say that a connected component in a graph $G = (V,E)$ is an inclusionwise minimal non-empty vertex set $C \subseteq V$ such that every edge $e\in E$ having one endpoint in $C$ does in fact have both endpoints in $C$. (In other words, a minimal non-empty vertex set that has no edges going in/going out.) Let $C$ be a component and let $a\in C$ be fixed. Now let $F_a \subseteq V$ be the set of vertices that can be reached from $a$ through a path of finite length. Now:

We can prove by induction that $F_a \subseteq C$ must hold: we have $a \in C$, so every neighbour of $a$ must also belong to $C$, and every neighbour of every neighbour of $a$ must then also belong to $C$, and so on.
On the other hand, one easily shows that $F_a$ satisfies the property described above, namely that every edge having one endpoint in $F_a$ also has the other endpoint in $F_a$. Thus, by minimality of $C$, we cannot have $F_a \subsetneq C$, so we find that $F_a = C$ must hold.

Thus, indeed we see that vertices belonging to the same component can be joined by a finite path. (We have to be a bit careful with this approach: it is not a priori clear from the definition that connected components should exist at all, or that two connected components $C_1,C_2\subseteq V$ are either equal or disjoint. Luckily, one easily shows that $F_a$ is indeed a connected component for every fixed $a\in V$, and the remaining properties can be deduced after that.)
Various standard examples of infinite graphs are connected in this sense: the ray $\mathbb{N}$, the double ray $\mathbb{Z}$, the (countably) infinite complete binary tree, but also the unit distance graph of the plane, where the vertex set is $\mathbb{R}^2$, and two vertices are connected if and only if the Euclidean distance between them is exactly $1$. (Fun exercise: find a formula for the length of the shortest path between two points in the unit distance graph.)

Off topic: It is quite interesting to consider a more abstract type of path, which is indexed by other kinds of sets. For instance, user GregRos gives a list of requirements for the index set $I$: it must be a bounded linearly ordered set, and every element must have a unique successor (except for the greatest element) and predecessor (except for the least element). Let us call the connected components for this generalised notion of paths the generalised components.
I'm a little confused by the example he provides, since I am unfamiliar with the hypperreals, but it seems that one fundamental requirement is still missing: $I$ should itself be connected in some sense. For instance, consider the following example:

Example. Consider the index set $I = \mathbb{Z}$ with the linear order $\prec$ defined in the following way: $$ 0 \prec 1 \prec 2 \prec 3 \prec \cdots \prec -4 \prec -3 \prec -2 \prec -1. $$
  That is, the subsets $\mathbb{Z}_{\geq 0}$ and $\mathbb{Z}_{<0}$ are ordered in the usual way, but we declare that every negative number is larger than every non-negative number. The order is indeed linear and bounded: the greatest element is $-1$ and the least element is $0$. Furthermore, every element has a unique successor (except for the greatest element) and a unique predecessor (except for the least element). Thus, this ordered set meets all the requirements. Note that there is no edge going from $\mathbb{Z}_{\geq 0}$ to $\mathbb{Z}_{<0}$. Therefore any pair of rays in an infinite graph can be joined by a path indexed by $(\mathbb{Z},\prec)$.

The path from the example above is essentially the only new type of path that we gain from this generalisation:

Proposition. Let $P$ be an infinite path indexed by an index set $I$ that meets GregRos's requirements. Then $P$ contains a subpath indexed by the ordered set $(\mathbb{Z},\prec)$ from the example above.
Proof. Let $a$ and $b$ be the endpoints of $P$ and let $s : P \setminus\{b\} \to P$ and $p : P \setminus\{a\} \to P$ denote the successor and predecessor functions on $P$. Define $x_0,x_1,x_2,\ldots$ recursively by setting
  $$ x_n = \begin{cases}
     a,&\quad\text{if $n = 0$};\\[1ex]
     s(x_{n-1}),&\quad\text{if $n > 0$}.
\end{cases} $$
  This is well defined since the path $P$ is assumed to be infinite (at every step we have $x_n \neq b$, so that $x_n$ has a successor). Similarly, we define $x_{-1},x_{-2},x_{-3},\ldots$ recursively by setting
  $$ x_n = \begin{cases}
     b,&\quad\text{if $n = -1$};\\[1ex]
     p(x_{n+1}),&\quad\text{if $n < -1$}.
\end{cases} $$
  We see that $\{x_n\}_{n\in\mathbb{Z}}$ is a path indexed by $(\mathbb{Z},\prec)$.$\hspace{2mm}\blacksquare$

Thus, if we have two vertices $a$ and $b$ that can be joined by an infinite path, they can also be joined by a path indexed by $(\mathbb{Z},\prec)$. Now it is easy to determine the connected components according to this wider definition of paths:

Proposition. Two vertices $a$ and $b$ lie in the same generalised component if and only if at least one of the following criteria is met:

There is a finite path joining $a$ and $b$.
Both $a$ and $b$ lie on a ray.


Note: for every original component we have that either every vertex or no vertex of the component lies on a ray. Thus, when we consider this generalisation of the concept of paths, we essentially obtain a sort of one-point compactification of our original graph: we have the same components as before, except that the components containing a ray are joined at infinity. (Note however that the disjoint union of the countably infinite star graph $S_{\omega}$ and a ray is still disconnected, for only one of the components contains a ray. In particular, there might be more than one generalised component with infinitely many vertices. So perhaps my comparison with one-point compactifications is a little confusing: one might argue that the countably infinite star graph $S_{\omega}$ is not locally compact to begin with.)
This is all very interesting, but in the literature it is assumed that vertices in the same component are joined by a finite path.