With a 5 gallon you cannot have fish friends, which leaves three options.
A pair of ADFs, some shrimps, or a snail, also a cycled matured tank is needed for all of these tankmates, to ensure that they'll not cause a big fluctuation in water parameters when introduced into the tank.
A pair of ADFs would be pushing the bioload in a 5g, you might have to up the water changes a bit.
Shrimps are a hit or miss, depends on your Betta's temper, he might kill them/eat them. Give them enough cover with moss, and decorations like caves. You could do ghost shrimps which are cheap, or a dwarf species like RCS. Amano shrimps are good algae eaters and are big enough to withstand a Betta's attack I believe.
Snails, a Nerite snail would do great in a 5g. Great algae eaters and their eggs cannot be hatched in freshwater.