The most likely cause is stagnant and polluted water. Beta fish are billed as being able to live in these small setups because they are able to gulp fresh air.
However fish, like any other living being, produce wastes and in such a small environment they build up to toxic levels quickly. A lot of people think it's okay to keep them in the small bowls, mostly because pet stores have made it public opinion that it's the best setup for them. You'll see them in the itty bitty plastic cups and think that the 2.5cup container with the pretty rocks is an upgrade.
The best thing you could do for this fish, for the least money, is to run to Walmart, amazon, or another pet store and buy a 5gal hex with a build in filter and light. I do know Walmart had a 2.5gal with a filter and light. It might work well, but I did a cursory search and a tank like this is just under $40. Barring it being too sick already, I'll guarantee that your new fish will be up and swimming in the return stream fairly quickly. It'll put on color and be much flashier. It'll start eating again as well.
The filter will filter out the wastes and it won't sit there coated in them anymore, the filter return will provide stimulation and make it swim more, which helps it put on muscle and encourages it to show it's fins. Keep in mind while doing this upgrade, that the tank needs to cycle. You can find lots of info on that online. Taking a little water from it's tank or a pet store tank will greatly reduce the wait time on this. You need to let healthy bacteria establish to help break down the fish waste. I'd immediately change half of the fish's current water and feed him a very small amount till he gets in the new tank. Good luck.