In addition to SicFan's answer; a few things to consider.
If you're removing the Apple ID to issue the device to a new (or same) person who will be using a new Apple ID, the best thing to do is to restore the device to factory settings. The easiest way to do that is to go to Settings > General > Reset > Erase all Contents and Settings. The next time the device is started it will go through a set up procedure, just like it did when it came out of the box.
Warning: If you have already upgraded to iOS 7 then you may need the Apple ID to clear the device this way. Depends on whether you've set up the passcode or and feature or not. iOS 7 prompts you to do this during the setup.
If you just want the Apple ID off the device but everything else intact, you'll have to go through every iStore and the settings for iCloud, FaceTime, iMessages (and possible a couple other places) and sign out of them. Hold in mind that you won't be able to update apps on the device without signing back into the App Store using the Apple ID that was used to purchase those apps.
On the other hand if you merely want to stop someone from doing things with the account you may be able to accomplish your goal using Restrictions in Settings > General > Restrictions (don't forget that passcode if you set it up).