That would be "unlocking." Jailbreaking is just opening it up for unapproved 3rd party software (basically, it allows you root access to the phone). Unlocking is what unties the phone from the carrier.
In the US there is no "legal" way to unlock the phone, even if you are no longer using it.