There are a couple of studies that came to the conclusion that over the long run doing strength training helps with muscle retention even if you do them fasted for hours or for days.
But honestly, losing muscle size isn’t the end of the world. It’s actually kinda good if the old proteins that are folded in weird ways get recycled (autophagy) because newly built up muscles can exercise more strength per volume in comparison.
But then again there are also a lot of studies that correlate autophagy with physical exercise. So in the end you’re probably free to choose either way without much consequence.
While fasting for how long? 12 hours? 16? 18? 20?
And what do you mean by exercising? A jog? a marathon? Pilates? Power lifting?
And what do you mean by supposed? As in whether there is some hard rule about it?