FOOL: ...We'll set thee to school to an ant, to teach thee there's no labouring i' the winter. All that follow their noses are led by their eyes but blind men; and there's not a nose among twenty but can smell him that's stinking. Let go thy hold when a great wheel runs down a hill, lest it break thy neck with following it; but the great one that goes up the hill, let him drew thee after. When a wise man gives thee better council, give me mine again; I would have none but knaves follow it, since a fool gives it.
That sir which serves and seeks for gain,
And follows but for form,
Will pack when it begins to rain,
And leave thee in the storm.
But I will tarry; the Fool will stay,
And let the wise man fly:
The knave turns fool that runs away;
The fool no knave, perdy.
KENT: Where learned you this, fool?
FOOL: Not i' the stocks, fool.
King Lear Act II. sc. iv.
I had to provide the full segment of conversation between Kent and the Fool because the quote is useless on its own. Kent was put in the stocks because he lost his temper around Oswald. He called Oswald:
" A knave; a rascal, an eater of broken meats; a base, proud, shallow, beggarly, three-suited, hundred-pound, filthy, worsted-stocking knave; a lily-livered, action-taking knave, a whoreson, glass-gazing, superserviceable, finical rogue; one-trunk-inheriting slave; one that wouldst be a bawd, in way of good service, and art nothing but the composition of a knave, beggar, coward, pandar, and the son and heir of a mongrel bitch..." (Act II. sc ii.)
After Kent started wailing on Oswald he was put in the stocks for his behaviour and this was where King Lear found him upon arrival at the castle. There was some discussion about his position (on his arse with his legs in the stocks) and the Fool lectured Kent on not losing his temper when no others can see the fault, but instead following the ways of wise men. That's the first part the Fool says at the top. My favourite quote is the Fool's answer to Kent's scathing question of "where did you learn this, fool?"
What a brilliant come-back. "Not i' the stocks, fool."