What do you mean by returning? When you upgrade, you will keep your purchased iPhone. What you may want to do is transfer your existing number to the new device. At that time, the old iPhone can be used as an iPod Touch, or if you have unlocked it, as a pre-paid iPhone.
Sorry. My bad. For piece of mind, you can restore back to factory settings. You don't have to. The techs at AT&T will not check whether it has been jailbroken. If you were returning the device under warranty, you would want to restore. Apple will eventually get your V1 iPhone, refurb it, and make it available again as a replacement for another customer's V1 iPhone. Firmware will be restored regardless.