If it's politically inadvisable to work your ass off, for example because it makes your less dedicated peers look bad, then this can be good advice.
Given my druthers, though, I'll do the best work my talent and skill make possible, for two reasons: first, should I find myself having trouble in a given situation, I find it strongly preferable to have the certainty that it's for some other reason than because I'm not working at the top of my form; second, because if I should find myself in need of support from management, it's a lot easier to start that conversation, and achieve a favorable result, when the fact that I'm working at the top of my form is obvious to everyone involved.
Of course, not everyone shares that opinion, and my own experience isn't universal. But I will note that I've never found myself in a situation where I had peers gunning for me because I was making them look bad -- on the contrary, one of the benefits of an insatiable appetite for hard work is that others quickly learn I can be relied upon to help them out when they need it, while rarely asking for such help myself. Quite aside from the fact that helpfulness is one of the criteria by which I evaluate my worth as a human being, this gives my colleagues the very best of reasons -- those of self-interest -- to bend their every political effort on my behalf.
This, by the way, is an example of what I mean, else-thread, when I talk about playing office politics in a principled fashion. Sure, there's some of my own self-interest in the mix here! I don't deny it. On the other hand, I've found a way in which I can serve not just my own interests, but those of my colleagues, and of the organization as a whole, all at the same time -- in short, a style of play that redounds to the benefit of all involved, and an excellent illustration of how it's possible to play office politics quite adroitly indeed, without having to become a Machiavellian bastard in the process.