Both men and women benefit from putting on lean mass and losing fat mass. Fat mass that is too high and lean mass that is too low are both associated with increased risk for all-cause mortality.
A recent study out of China showed that keeping a lower fat mass as a young adult and a higher lean mass as an older adult are the best ways to reduce mortality risk.
Another study out of South Korea showed that a low weight measured by BMI in the elderly did not lead to longevity, however having more muscle mass measured by LMI did. This study also showed that keeping a low BMI at a younger age has a higher correlation with longevity than LMI.
These studies conclude that keeping a healthy body weight is the best way to reduce mortality at a younger age while having increased lean mass becomes more important as we get older. This reinforces the value of strength, measured by grip strength, as a predictor of mortality.
To cover all the bases, it would be best to continue building muscle or maintaining muscle late into life while keeping a healthy body weight. Focus on eating foods that are in their natural form; vegetables, nuts, seeds, meats, fish, and fruits, in this order; eating a full spectrum of them at levels that support exercise but not body fat. Invest in at least 150 to 300 minutes of moderate to vigorous physical activity per week, with at least twice-weekly resistance training that hits every major muscle group at least once per week. Finally, get at least 7 hours of sleep every night, preferably the same 7 hours.