It has recently been shown that in every spatial dimension there exist precisely five distinct classes of topological insulators or superconductors. Within a given class, the different topological sectors can be distinguished, depending on the case, by a Z or a Z_2 topological invariant. This is an exhaustive classification. Here we construct representatives of topological insulators and superconductors for all five classes and in arbitrary spatial dimension d, in terms of Dirac Hamiltonians. Using these representatives we demonstrate how topological insulators (superconductors) in different dimensions and different classes can be related via dimensional reduction by compactifying one or more spatial dimensions (in Kaluza-Klein-like fashion). For Z-topological insulators (superconductors) this proceeds by descending by one dimension at a time into a different class. The Z_2-topological insulators (superconductors), on the other hand, are shown to be lower-dimensional descendants of parent Z-topological insulators in the same class, from which they inherit their topological properties. The 8-fold periodicity in dimension d that exists for topological insulators (superconductors) with Hamiltonians satisfying at least one reality condition (arising from time-reversal or charge-conjugation/particle-hole symmetries) is a reflection of the 8-fold periodicity of the spinor representations of the orthogonal groups SO(N) (a form of Bott periodicity). We derive a relation between the topological invariant that characterizes topological insulators/superconductors with chiral symmetry and the Chern-Simons invariant: it relates the invariant to the electric polarization (d=1), or to the magnetoelectric polarizability (d=3). Finally, we discuss topological field theories describing the space time theory of linear responses, and study how the presence of inversion symmetry modifies the classification.