Congrats on joining a gym!
It's kind of a misleading to say that "muscle is heavier than fat." First of all, it implies that we build muscle quickly, that fat turns into muscle, etc. As females we CANNOT build the type of muscle that will add pounds the scale unless we are lifting EXTREMELY heavy (as in, professionally). Cardio and the type of lifting will absolutely not add muscle weight that will show up on the scale.
I say all this because I think it's really easy when you start exercising to eat more calories, either as a reward ("I worked out today, I get a medium latte instead of a small one.") or unconsciously (For some, exercise stokes the appetite.) Some people see a stall or an increase in weight due to these reasons- and assume it's because "muscle weights more than fat." But the idea that you are building muscle and that's why you are gaining diverts the attention from the real problem- eating too much!
Water retention IS real, so it's really good you are aware of it! That definitely can add a few pounds to the scale when you first start a new exercise regimen. Likely it will happen suddenly (the day after a workout), not gradually, like real weight gain. When this happens you can be pretty sure it's due to water retention.
Personally I LOVE exercising- I love being sore and I love seeing my body do amazing things. I think just being cognizant that it might lead to a slight stall at the beginning is enough, personally. Give it a few weeks for the body to adjust. And then wait for the whoosh that will come