  In this paper, we study the behaviour at infinity of $p$-Sobolev functions in
the setting of Ahlfors $Q$-regular metric measure spaces supporting a
$p$-Poincar\'e inequality. By introducing the notions of sets which are
$p$-thin at infinity, we show that functions in the homogeneous space $\dot
N^{1,p}(X)$ necessarily have limits at infinity outside of $p$-thin sets, when
$1\le p<Q<+\infty$. When $p>Q$, we show by example that uniqueness of limits at
infinity may fail for functions in $\dot N^{1,p}(X)$. While functions in $\dot
N^{1,p}(X)$ may not have any reasonable limit at infinity when $p=Q$, we
introduce the notion of a $Q$-thick set at infinity, and characterize the
limits of functions in $\dot N^{1,Q}(X)$ along infinite curves in terms of
limits outside $Q$-thin sets and along $Q$-thick sets. By weakening the notion
of a thick set, we show that a function in $\dot N^{1,Q}(X)$ with a limit along
such an almost thick set may fail to have a limit along any infinite curve.
While homogeneous $p$-Sobolev functions may have infinite limits at infinity
when $p\ge Q$, we provide bounds on how quickly such functions may grow: when
$p=Q$, functions in $\dot N^{1,p}(X)$ have sub-logarithmic growth at infinity,
whereas when $p>Q$, such functions have growth at infinity controlled by
$d(\cdot, O)^{1-Q/p}$, where $O$ is a fixed base point in $X$. For the
inhomogeneous spaces $N^{1,p}(X)$, the phenomenon is different. We show that
for $1\le p\le Q$, the limit of a function $u\in N^{1,p}(X)$ is zero outside of
a $p$-thin set, whereas $\lim_{x\to+\infty}u(x)=0$ for all $u\in N^{1,p}(X)$
when $p>Q$.
