Scientists have discovered a species of ancient mammal that survived the event that led to the extinction of the dinosaurs.