Like many others, I just wanted to add my (somewhat lengthy) two cents with my personal experience.
I was using iOS 5 on my iPhone 4 until I bought a 4S at Best Buy a few days ago. At Best Buy, my SIM card was taken out of my 4 and put into the 4S. In the days I had both devices "activated" with my information, anytime both devices were on WiFi, any and all iMessages came to all devices (iPhone 4, iPhone 4S, and iPad 2). My iPhone 4 had NO SIM card, but had not been wiped or restored, I was still using it with all of my information. I then listed the phone on eBay. The night before the auction ended, I first did an "erase all content and settings" and then a restore as new through iTunes. That evening I only got iMessages on my iPhone 4S and iPad, they weren't coming through on my iPhone 4, even though they were still on the same WiFi network.
However, I am rather OCD and wanted to make sure all of my data was off the iPhone 4 (just as I did with my 3G when I sold it on eBay upon upgrading to the 4). All content and data was gone: camera roll was empty, contacts were blank, messages were empty, email wanted set up, everything. However, when I opened Game Center, my Apple ID was still in the username section. I WAS NOT logged in to game center, and it was asking for my Apple ID password, but my email address associated with my Apple ID was still in the username field. That was the only place I could find any remainder of my information, and I couldn't figure out how to get rid of it.
This is a really crummy situation to be in, and I do feel bad for the OP. As unfortunate as it is, I really think that the lack of a "complete" wipe or restore is the culprit in the situation. I haven't checked iMessage or phone settings to see if my number was still in there, and will do that tonight before I send the 4 out to the new owner. I would also like to add that when I did the "erase all content and data" there was no SIM card installed in the phone, and when I did the "set up as new iPhone" in iTunes, I had inserted the dummy, blank SIM card that came packaged with my 4S (since mine was just moved from the 4 to the 4s). So, it was restored and set up as new with blank information, nothing relating or attached to my phone number. Not sure if this has any influence on the information or not.