don't worry Rawrie, it's fine!
Though, yes, researching is always a good idea. Impulse buys aren't good when they concern animals, especially if you don't know how to care for them.
Look, for the time being he should be fine. At the moment, you have 3 choices. 1) return him 2) upgrade to a 10 gallon, cycle it and put your betta in there with the otto and buy your otto some friends 3) keep him as is.
if you keep your otto as is, he probably won't live as long as expected, and you increase the possiblity that your betta will attack him, however, I think it's possible to do so.
Feeding wise, if you have cucumbers or zuchinni, boil some pieces until they are sort of mushy, then sink them in there, or buy some algae wafers.