Yes, you can. Just make sure you sign in using your account first and download a couple of your purchased music. You have to make sure that first AppleID that you use is the one that has all your purchases. Once that happens, the device and the ID are married for 90 days. There is no way to break it. It's a new thing that Apple did sever months ago. It only applies to music/video, you can still re-download any app as long as your using the AppleID that originally bought it.
The caveat is, the AppleID that you're entering has to unattached to a device. IDs and devices are exclusive and doesn't expire for 90 days. Sucks I know. But, this only applies to music, videos, iTunes Match. You can still download apps.
Actually this is simpler than everyone says.
I set up my old iphone as new for my wife, with her Apple ID (for imessage, icloud, etc) - I did this over wifi, without connecting to the Mac. I then went into settings, store account, and changed that to my Apple ID (leaving all of the other features set to hers). Job done. Can go into App store, itunes, grab previous downloads. Then plugged it into the Mac and can add any apps and music to the iphone as if it were my own.
Same thing for her ipad.
Very neat.
PS - this is in iOS5, obviously.