By seeing whether a Liouville type theorem holds for positive, bounded, and/or finite p-energy p-harmonic and p-quasiharmonic functions, we classify proper metric spaces equipped with a locally doubling measure supporting a local p-Poincare inequality. Similar classifications have earlier been obtained for Riemann surfaces and Riemannian manifolds. We study the inclusions between these classes of metric measure spaces, and their relationship to the p-hyperbolicity of the metric space and its ends. In particular, we characterize spaces that carry nonconstant p-harmonic functions with finite p-energy as spaces having at least two well-separated p-hyperbolic sequences of sets towards infinity. We also show that every such space X has a function f is an element of/ LP(X) + R with finite p-energy.