HT4623: Update your iPhone, iPad, or iPod touchLearn about Update your iPhone, iPad, or iPod touch
Currently Being ModeratedDec 4, 2012 10:34 PM (in response to leticia0888)
If the device was purchased unlocked or has been officially unlocked by the carrier to whom it was locked, ugprading will never lock it.
If the device has been hacked or jailbroken to unlock it, then it is almost guaranteed that upgrading will relock it to the original carrier and possibly brick the device.
Currently Being ModeratedDec 4, 2012 11:12 PM (in response to leticia0888)
If by upgrade you mean the firmware, then: Connect to iTunes. From the summary screen select "Check for Updates"
if by upgrade you mean to the iPhone 5, then you need to simply go and by a new phone form the apple store or contact your carrier for options they may have.
selling an iPhone 4 on eBay or other similar sites is very straight forward