Can you fast without losing muscle?

No because the muscles need protein to grow or maintain themselves, if you are not getting protein they can't maintain a constant size or grow more and will lose bulk.