Actually I disagree. Corys do just fine singly and in pairs, though they are more interesting in schools.
I've kept corys in all sorts of tank sizes and school/non-school configurations. And honestly I have never noticed them to be any more or less happy in smaller or larger tanks, schools or non-schools.
Personally I am of the opinion that much of the idea that schooling fish need and require schools to flourish is just bunk. I have had several of these types of fish over the years that ended up alone because the school died off over time and I opted not to replace it, yet that last fish lives for many months or years perfectly happy without anyone to school with. Conclusion: schooling fish are just schooling fish, they are not "schooling to survive" fish. Keeping a school is therefore purely for the interest of the aquarist, not a requirement for the fish to do well.
The next thing is tank size. This is largely another idea that doesn't hold water (hehe I make pun!) in my opinion or experience. The corys in my five gallon tank seem no less happy than the corys in my 55g. In fact, I have lost more in my 55g than in my 5g! This same theory has gone for many other small fish that are said to need ridiculously large tanks to survive. ( I have even read posts from people who insist that you shouldn't keep a betta in anything less than a 30g tank!!)
Okay...I am totally babbling on. Long story short, a pair of small corys will do just fine in your 5g tank.