When i had a 1/2gal tank the same-ish thing happened to my betta.
I kept a bottle (1gal) of conditioned water by his tank (24hrs) so it would get to the same temp as the water in his tank.....then mix the proper amount of aquarium salts in the bottle so its completely diluted.
Use that water for his water change......you should see an difference with the salts within hours....with my betta they really do work wonders!
Good luck! Dont give up......but dont waste time treating him with the salts....do it asap