A Bacteria infection is easy to get rid of, if you go to Bettatalk.com they will tell you the meds you need, but most likly I would suggest adding a little aquarium salt to your water just incase it's outer bacterial infections, if it's inside.
Feed him some betta Biogold insted of fish flakes, it will bring up his emmune systum. You could also check on betta colors, some bettas are white by nature with red spots all over the body, I saw one that won a contest for best in type called the Corriander betta, it was pearly white colored with blood red spots on it's head to apear like a sword shark =3 it was cool , but if he's lazy it's most likly Internal Parasites . And for both you dont even need to go to Bettatalk,com to find out o_o just clean his water and be sure the filter is working, if you dont have a filter o_o get a tube, a one inch filter stone, a Hawkey air filter, and make the light only be on for 8 hours a day insted of the more liked 12 hours for your betta cause it will help him dyjest biogold faster pushing the bacteria where meds will help.
Then before puting him in after aclimating, put in a desent amount of AQUATIC tetracyclin, then after you do that put in some Aquarium salt * no murine salt please X_X!!!. And place him in the water after 20 mins.
Every week do another water change, and repeat the prossess intill they go away ( 4-8 weeks)
If it still doesint go away it may be in depth and I wouldint give up on him o.o,. On the 8th water change get rid of the tetracyclin and in place use a half a teaspoon more of Aquarium salt, and put in some kanamycin you can find both meds in your local pet store under filtration- animal health produse if it doesint have a fish area. Then use that for another four weeks or untill it clears up and he starts acting more happy =3 After that do a final water change on the fith week and put less then the suggested dose of kanamycin
or tetracyclin In so it doesint become dependent, then in two weeks do another full water changes and leave it with only a teaspoon or less of aquarium salt, after that he should be just fine and every month do another half teaspoon aquarium salt since he possably is weak to bacterial infections and will need this the rest of his fishie life so he will be safe =3.
Trust me, that always works and I have seen it o.o.
if you still need help >
http://bettatalk.com/betta_diseases.htm
I always hate pet stores that let them get into that condision ><Mine had that and advanced stages of fin rot when I got him, then a few days laiter he got Inflamed Gills, then he had Tuberculosis and now any fish I put into his tank die away imediatlyX_X...