"To thine own self be true" is Polonius's last piece of advice to his son Laertes, who is in a hurry to get on the next boat to Paris, where he'll be safe from his father's long-winded speeches.
Polonius has in mind something much more Elizabethan than the New Age self-knowledge that the phrase now suggests. As Polonius sees it, borrowing money, loaning money, carousing with women of dubious character, and other intemperate pursuits are "false" to the self. By "false" Polonius seems to mean "disadvantageous" or "detrimental to your image"; by "true" he means "loyal to your own best interests." Take care of yourself first, he counsels, and that way you'll be in a position to take care of others. There is wisdom in the old man's warnings, of course; but he repeats orthodox platitudes with unwonted self-satisfaction. Polonius, who is deeply impressed with his wordliness, has perfected the arts of protecting his interests and of projecting seeming virtues, his method of being "true" to others. Never mind that this includes spying on Hamlet for King Claudius. Never mind, as well, that many of Polonius's haughty, if not trite, kernels of wisdom are now taken as Shakespeare's own wise pronouncements on living a proper life.