Like other people have already mentioned, I would think about upgrading the tank to something larger. You can keep a betta in a 2.5 gallon tank (they make great rectangular ones that look like miniature versions of a ten gallon that sell for about $11) but he'd be even more happy in a five gallon more more tank.
My two guesses about his behavior would be either that he's far too cold or that he's suffering from ammonia/nitrite poisoning. Do you have a heater in the tank? Bettas need to live at around 78*F, so in most cases room temperature is not warm enough. I would use caution about some of the smaller heaters, though. I've tried several different brands and have found that in most cases they overheat the water in even 2.5 gallon tanks. Sometimes the aquarium lights on a tank that small can do a decent job of heating the water to the appropriate temperature. I would at least get a thermometer (they sell very inexpensive stick-on thermometers at pet stores, but in-tank ones are even better) to make sure that your fish isn't too cold.
Did you let the tank cycle before you put him in? Sometimes it can be very difficult to cycle such small tanks, so usually it's better to change his water by 50% every two days or so. This will eliminate wastes in the water that are toxic to your fish and cause lethargic behavior (as well as eventually just killing them outright).
I would recommend returning the algae eater. Any sort of algae eating fish is going to need more space than a 1g tank as anything but an Oto would need more room than that and even an Oto produces far too much waste for a 1g tank to handle. In a tank that small, you're better off just cleaning the algae yourself.