Rooting is complicated…
Rooting is a complicated process, and jailbreaking isn’t all that simple either. When you root someone else’s phone—especially someone who isn’t very tech savvy—you’re altering it in a way they don’t understand (because they haven’t researched the process). That means that any problem they have, they’re likely to come to you for help or at least blame it on “what you’ve done to their phone”—even if their problem has nothing to do with your rooting it. And, either way, you’ve voided their warranty, so they can’t take it into their official source of tech support anymore—that responsibility falls squarely on your shoulders.
…and you’re responsible if trouble arises…
This is not only annoying, but it poses some serious issues if, say, their phone becomes unusable for any reason. Our phones are pretty central to our lives, and while you may have a contingency plan or an old phone to save you in such emergencies, those less familiar with the process won’t—and if you can’t be around to solve emergencies, your friend is now phone-less (and probably pretty ticked).
I’m not saying all of these things will happen, of course. If you’re just rooting to remove some of the crapware or install a tethering app, you might be okay. You’re less likely to cause problems they can’t solve, though they will still come to you for phone issues, root-related or not. I definitely wouldn’t recommend flashing a custom ROM or performing any complicated jailbreak tweaks (in the case of the iPhone), since those are a lot more likely to break or cause problems.
…so you should definitely think twice.
So should you do it? Obviously, I don’t recommend it. Certain factors can make it more of a toss-up, such as a low level of tweaking, a tech-savvier friend, or closer proximity to them (fixing your roommate’s phone is going to be a lot easier than fixing your out-of-town relative’s). A better idea, though, would be to help them research the rooting or jalibreaking process, so they know a bit more about what’s going on. This will either a) give them the ability to troubleshoot their own phone, or b) make them realize that this really isn’t a good idea. As always, the choice is yours, just be prepared for the responsibilities you’ll have if you decide to go through with it.