Do you lose muscle as well as fat when you lose weight quickly?
Weight loss is not purely fat loss. Some lean tissue, including muscle, is commonly lost alongside it, and the faster the loss the more attention this tends to get. Muscle matters beyond appearance: it is involved in strength, balance, and day-to-day function as you age.
The public guidance is consistent on what helps. The Physical Activity Guidelines for Americans recommend muscle-strengthening activity on two or more days a week for adults, alongside aerobic activity, and the National Institute on Aging describes strength as one of four types of exercise worth doing rather than an optional extra.
Adequate protein is generally discussed alongside resistance training in this context. How much applies to you depends on your body, your kidney function and what else you are being treated for, which makes it a question for a clinician or dietitian rather than a general page.