How will you ever have the strength to life enough weight to change your body composition if you don't eat before the gym?
I'm not being sarcastic here, but - YES - eat before you go to the gym.
If you're focused on hypertrophy, you must eat and eat right.
If you're on a keto kick, get off of it for god's sake!