As far as I understand it, rooting your phone voids your warranty, but it can also be reversed and the manufacturer would never know.
My question is a bit more specific. I bought a Nexus S about seven months ago, and it came broken. At the time, there was a bug in some Nexus S handsets that caused them to randomly reboot, and I figured it was that and gritted my teeth until the update came. When it came, and didn't fix my phone, I had it sent back to Samsung immediately to be replaced.
They told me they had found a fault and that they had fixed it, and, sure enough, it no longer randomly froze and rebooted. 2.3.4 rolled along, and broke my WiFi (2.3.5/6 didn't fix it), so when kwibo posted the ASOP ICS ROM for Nexus S, and Google refused to show any inclination to get the Nexus S ICS update out, I decided to root my phone and put the ASOP ROM on.
I followed the instructions and found that my phone was already rooted. I did some research and found no evidence that Nexus S' are sold rooted, so I assumed it had been done as part of the fix, which doesn't bother me, but what I want to know is, if my phone had broken again, would Samsung have tried to claim I had voided the warranty by rooting it? Would there have been any way to prove I hadn't?