How could I of gained 7 lbs. In 1 week when I take exercise class 3 days a week and haven't changed eating habits.?

Water retention. Water retention is one of the most common causes of rapid weight gain. Fortunately it should be transient. Excessive salt intake or hormonal fluctuations are the first things to consider.
Calorie journal. There are only two ways to think about weight. In must equal out to maintain. If your in is more than your out, then that is where to start. Ins could be more muscle from exercise, more fluid retention and more calories in. The decrease in out would be maybe your exercise routine has plateaued and you have to change that to burn more calories. Keep a journal of calories in & calories out.