I'm near a good router with three bars of wifi, yet it keeps disconnecting then reconnecting. This may be an iOS 5.1 issue.
- A reset. Nothing is lost
Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
least ten seconds, until the Apple logo appears.
- Power off and then back on your router
- Reset network settings: Settings>General>Reset>Reset Network Settings
- Restore from backup
- Restore to factory defaults/new iPod
- You could also have an interference problem from another device like micrwave or other device.