In India power cut is often. And most houses are installed with Inver-battery, for backup till the power comes back. But since all inverters don't behave as ups, there occour a little gap between the power switching i.e. from main power to battery power. Gap is roughly lasts for 1-2 seconds. And during that gap my router turns off for obvious reason. Can i do something to cover this gap and prevent it from turning down? I've tried using two 220uF capacitors in paralled to power supply input in router but nothing noticable happened. Power supply for router is of 12 V 0.5 A. Please help.
Something a little cheaper than a mains voltage UPS is like:-
which you can read about here. It does what you want without the inverter/step up components to produce mains level voltage.
The problem with your capacitor only solution is that the capacitors need to be pretty large, and commonly you'd use super capacitors. That then leads to huge inrush current management. And since most super caps are 2.7V, some form of voltage equalisation when you stack them up to increase voltage. A practical, safe and reliable circuit quickly gets complicated.
If you want a project, there are many DIY circuits on line for this exact scenario. If you simply want a solution, buy one of the above like thingies.