Does the theme of self-reliance occur anywhere in Shakespeare's Hamlet?
One obvious place in which the theme of self-reliance occurs is in Act 1, Scene 3 of the play in the famous advice by Polonius to his young son Laertes, who is on his way to the university in France.
There; my blessing with thee!
And these few precepts in thy memory
See thou character. Give thy thoughts no tongue,
Nor any unproportioned thought his act.
Be thou familiar, but by no means vulgar.
Those friends thou hast, and their adoption tried,
Grapple them to thy soul with hoops of steel;
But do not dull thy palm with entertainment
Of each new-hatch'd, unfledged comrade. Beware
Of entrance to a quarrel, but being in,
Bear't that the opposed may beware of thee.
Give every man thy ear, but few thy voice;
Take each man's censure, but reserve thy judgment.
Costly thy habit as thy purse can buy,
But not express'd in fancy; rich, not gaudy;
For the apparel oft proclaims the man,
And they in France of the best rank and station
Are of a most select and generous chief in that.
Neither a borrower nor a lender be;
For loan oft loses both itself and friend,
And borrowing dulls the edge of husbandry.
This above all: to thine own self be true,
And it must follow, as the night the day,
Thou canst not then be false to any man.
Laertes is a young man who is going to be on his own for the first time in his life, and much of what his father tells him has to do with looking out for himself. For example when he tells his son not to become either a borrower or a lender he explains that "borrowing dulls the edge of husbandry." This means that a person who is an habitual borrower loses his ability to discipline and look after himself, i.e., to remain self-reliant. When Polonius says, "Take each man's censure but reserve thy judgment," he means to listen to each man's advice but to rely on his own judgment.
Polonius advises Laertes to be careful about making friends, to keep his thoughts to himself--practically everything he tells his son has to do with remaining independent and self-reliant. And he concludes with his most important piece of advice:
This above all: to thine own self be true.
That is the essence of self-reliance. It includes reliance on one's own thinking, intuition, tastes, feelings, interests, beliefs, opinions, and everything else that a mature person inherits with the human brain to guide and protect him through life.
Ralph Emerson's most famous essay is titled "Self-Reliance." It ought to be read in connection with the question about self-reliance in Shakespeare's Hamlet. See reference link below.
Rudyard Kipling's famous poem "If" is largely about self-reliance. See reference link below.