New research finds that we tend to care more about the success of future generations when we are faced with our own mortality. Christie Nicholson reports