You have to take the medicines for your hypothyroidism
Obesity can result in irregular periods
Your problem is not because of going to gym.
You must go for regular gym along with reduction in your calories for reduction of weight
You may be suffering from POLY CYSTIC ovaries so you get hormonal
studies done to rule this out.
Consult a gynecologist for the required investigations.