  We consider the effects of impurities on topological insulators and
superconductors. We start by identifying the general conditions under which the
eigenenergies of an arbitrary Hamiltonian H belonging to one of the
Altland-Zirnbauer symmetry classes undergo a robust zero energy crossing as a
function of an external parameter which can be, for example, the impurity
strength. We define a generalized root of \det H, and use it to predict or rule
out robust zero-energy crossings in all symmetry classes. We complement this
result with an analysis based on almost degenerate perturbation theory, which
allows a derivation of the asymptotic low-energy behavior of the ensemble
averaged density of states $\rho \sim E^\alpha$ for all symmetry classes, and
makes it transparent that the exponent \alpha\ does not depend on the choice of
the random matrix ensemble. Finally, we show that a lattice of impurities can
drive a topologically trivial system into a nontrivial phase, and in particular
we demonstrate that impurity bands carrying extremely large Chern numbers can
appear in different symmetry classes of two-dimensional topological insulators
and superconductors. We use the generalized root of \det H(k) to reveal a
spiderweblike momentum space structure of the energy gap closings that separate
the topologically distinct phases in p_x + i p_y superconductors in the
presence of an impurity lattice.
