Bettacrazy is correct..
Betta fish are tropical fish and do best in warmer waters such as stated above.. in a half gallon you will not be able to find a heater that will fit, nor be safe in that size. I would get no less than a gallon tank with a 15-25 watt heater. Cold water such as that will lead to weak immune system, slow metabolism and less of a life span.
The food.. flakes aren't bad for bettas as long as they are flakes specific for bettas. Regular tropical flakes have too much plant matter in it, whereas bettas are insectivores and carnivores and require more of a fish/meat meal type of food. Make sure the food you purchase has fish or meat (even if it's "meal") as the first ingredient.
Fish should be fed daily - best to have 2 small meals per day to keep their energy and nutrition up. They are (should be) swimming most of the time outside from sleep and they require lots of energy which is brought on by food.
Water changes are the top priority when it comes to all fish. For that size of a tank I would do water changes ever 3 days. A betta doesn't let off as much ammonia as most other fish due to their labyrinth organ, but they still do in their waste. You don't want the water too clean/sterile, but it can't become bad either.. so for a half gallon, you are looking at a 100% every 3 days.. a one gallon it's 1 50% and 1 100% per week.. and then the bigger the tank the less water changes (to a point) - you will always need to do water changes each week regardless of the size - it's the % that will change depending upon tank set up.
Water conditioner is a must to remove chlorine, ammonia and heavy metals.. dose for full volume of the tank each water change.
Having ick a few times and only had him a year isn't good on his system, correct water changes, conditioner, food and warmth will help keep him healthy. He is most likely eating his fins or he has fin rot which is brought on by a damaged fin that is in poor water and bacteria has set in and is eating away at the fin. Good water quality (water changes) should help reverse that.. if not he may need to go on a salt treatment.. pictures, if you can, will help us determine whether it's bacteria (rot) or fin biting from stress.
Bettas don't live in puddles and they (the wild type, but the domestics we breed still require the same care) come from tropical climates.. where they have miles of water expanse and heated well into the 80s. Bettas are sold in cups for their own safety, and because of that sadly, people assume they are fine in small bowls with no heat or water changes. It's a myth that has been around for decades, and I don't blame people for not knowing.. but it is a good thing you came here so you can get the proper knowledge on their care. They are easy in a sense that they don't need a filter and can live in smaller aquariums (like 1-5 gallons) easier.. but they still have the same requirements as other fish when it comes to basic care.
I wish you luck..