Can a jailbroken iPhone 3GS be safely upgraded to the latest iOS via iTunes? If someone has an unlocked, jailbroken phone, what will happen if the update button is clicked in iTunes? Will the phone be updated and work? My friend wants to do that.

I did the same a month ago when my friend gave me the iPhone and everything worked well. His phone was also unlocked and jailbroken, but, after the update, I wasn't required to do any of the stuff. My phone is working well and I am able to download and purchase apps from the App Store.

Should I proceed with updating my friend's phone too?
Go for it! You'll lose the jail break (duh!) but it'll restore to a normal state like any other iPhone.