Given a function f : X → R on a topological space, we consider the preimages of intervals and their homology groups and show how to read the ranks of these groups from the extended persistence diagram of f. In addition, we quantify the robustness of the homology classes under perturbations of f using well groups, and we show how to read the ranks of these groups from the same extended persistence diagram. The special case X = R3 has ramifications in the fields of medical imaging and scientific visualization. Keywords. Topological spaces, continuous functions, interlevel sets, homology, extended persistence, perturbations, well groups, robustness.