  We use dynamical system methods to explore the general behaviour of $f(T)$
cosmology. In contrast to the standard applications of dynamical analysis, we
present a way to transform the equations into a one-dimensional autonomous
system, taking advantage of the crucial property that the torsion scalar in
flat FRW geometry is just a function of the Hubble function, thus the field
equations include only up to first derivatives of it, and therefore in a
general $f(T)$ cosmological scenario every quantity is expressed only in terms
of the Hubble function. The great advantage is that for one-dimensional systems
it is easy to construct the phase space portraits, and thus extract information
and explore in detail the features and possible behaviours of $f(T)$ cosmology.
We utilize the phase space portraits and we show that $f(T)$ cosmology can
describe the universe evolution in agreement with observations, namely starting
from a Big Bang singularity, evolving into the subsequent thermal history and
the matter domination, entering into a late-time accelerated expansion, and
resulting to the de Sitter phase in the far future. Nevertheless, $f(T)$
cosmology can present a rich class of more exotic behaviours, such as the
cosmological bounce and turnaround, the phantom-divide crossing, the Big Brake
and the Big Crunch, and it may exhibit various singularities, including the
non-harmful ones of type II and type IV. We study the phase space of three
specific viable $f(T)$ models offering a complete picture. Moreover, we present
a new model of $f(T)$ gravity that can lead to a universe in agreement with
observations, free of perturbative instabilities, and applying the Om(z)
diagnostic test we confirm that it is in agreement with the combination of
SNIa, BAO and CMB data at 1$\sigma$ confidence level.
