Advice!!

Okay, I go in and out of having an appetite some days I do and some I don't. I been trying to loose weight lately as well. I'm having trouble with that it's like everytime I lose 5 pounds I gain another 3. Does anyone know what I can do to prevent gaining back the weigh I loose? I don't eat 4 hours before I go to bed, I drink lots of water, and exercise. I need a bit help.