Q-"I'm currently on day 2 of a water fast. I'm gonna do it for a month or 40 days if I can. My first question is: can you still do exercises and play sports during the fast?"
A- Absolutely, but stay very well hydrated, that's the most important advice I can give you.
I have done several fasts, including a 1-month one, and I've never stopped exercising during these fasts. I remember climbing a mountain with some friends while I was on Day 7 of a water fast.
But before you exercise, please read up on the process of ketosis. The brain needs the body to convert the excess of fat to energy it can use and this is a lengthly process.
Therefore to avoid fainting, you should not push yourself to the max, rather you should do exercise that do not burn say, more than 400-500 calories per hour.
Walking is good, if you do more intensive stuff, take some breaks every 5 minutes or so to make sure the body has enough time to "feed" the brain, or else, you will faint and possibly hurt yourself badly (and take some brain cells away with it).
But, don't worry, I exercised every day during my fasts, just be aware of the risks, and don't push yourself too hard. Big nasty disclaimer: ask your MD or nutritionist before.
Q-"Secondly, I'm wondering what kind of diet I should be on 'after the fast' - to prevent gaining back all the weight I lose."
A-It's easy, first day, limit yourself to about 200 calories of fruits, then add 200 calories per day to reach whichever number of calories is appropriate for your body.
Why fruits? Because they're very easy to digest and that's required because your intestinal system has been shutdown for weeks.
That's what I did after my last 31-days water fast, and it worked wonderfully. If you overeat, you'll intoxicate your body and lose the benefits of the water fast.
I understand it's more easily said than done, but trust me, I've been there several times before, and that's the best advice I can give you.