Do you use a water conditioner when changing the water? It's like a chemical that neutralizes toxic substances in raw tap water. Like chlorine and chloramine.
Bad water is usually the cause of most fish diseases since a fish is usually battling several bacteria and viruses at a time, but their immune system can usually handle these until some environmental problems raise the level of stress on the fish, weakening it and making it more susceptible to infection.
Get yourself a nice 20 gallon tank for the fella, if he's a common goldfish, he needs all the swimming space he can get (: And it's generally not good to keep a fish in such a small space, especially in case he might be in a bad condition from before. But just keep an eye on this dude!

Just in case, it could be good for you to buy yourself a few more text kits, for ammonia, nitrite and nitrate so that you'll be prepared for the bigger tank and the cycle! (: