All these answers are incorrect. If you have 3GS or higher jailbreaking will not affect your speed. If it does happen to fail during jailbreak (happens every once in a while) you jus try it again lol. (restore and then jailbreak). You cannot upgrade your operating system hahaha that one made me laugh. If you restore before taking it into Apple they will NOT be able to tell. If you want more detailed explanations as to how I know this just ask in the comments.
I am a Windows expert with 7 years of programming experience. I have jailbroken over 50 devices and owned every single iPhone and currently run iPhone 4 iOS 4.3.1 Jailbroken with Redsn0w.
If you do decide to jailbreak. Google greenpois0n and use that. Easiest one for beginners.
It will most likely be really slow. Be careful about what you download. As far as I know, If you un jailbreak it they should still give you the warranty. I broke mine and un jail broke it and they repaired it for me so Im sure they'll do the same
1, You could successfully jailbreak your phone, which will void the warranty, as Bill_Hal said. And you will get tons of free apps, new themes, different faster operating systems, and tons of other stuff.
2. Which most often occurs especially for the unprepared person, the phone breaks, and you cannot replace it because Apple will know you tried and failed at jailbreaking.