It is a saying, or life advice perhaps. Not everyone is taught it. Where did it come from? The Bible? A philosopher? Literature? Does it have a canonical name?
It's a slightly different wording, but I found a very early example. From Sowing the Wind, 1867:
"Well, mamma, what good is there in asking things you don't want answered?" said Jane. "You should not have asked me if you do not want an answer."
This was the only example I found from before the 20th century.
According to a character in Frank Caceras, Bye the Book (2008), the expression is old:
There were several occasions when I suspected that Robert had been stealing from the company. There's an old saying that goes something like, 'Don't ask the question if you don't want to hear the answer.'
But finding old instances of the saying in print isn't easy. The earliest one that a Google Books search turns up appears in rhetorical interrogative form (without a question mark), from Edward Hegarty, Making What You Say Pay Off (1968) [combined snippets]:
- Listen to the Answer: Why ask the question if you did not want to hear the answer. Let the other know you heard his answer and show by your comments that you are interested.
An early instance of the expression framed as a rule appears in O'Neal Turner & John Pivovarnick, The Complete Idiot's Guide to Getting into College (1994) [combined snippets]:
Don't Ask Questions for the Sake of Asking Questions
By that I mean don't ask a question if you don't want to listen to the answer. Few things in this world are as frustrating to an interviewer as giving a thorough answer, only to find the student is paying no attention.
Nevertheless, the idea behind the saying is quite old. A relevant discussion appears in "Questions" in The Saturday Review of Politics (January 16, 1864):
There is a third habit of questioning much more common than either of the other two we have indicated, where the inquirer achieves all he aims at by putting an interruption in an interrogative form. Most persons known for asking questions never wait for an answer, and never want one. ... It is very rarely—only, we should say, in books composed in the form of dialogues—that information is ever imparted by the method of deliberate question and answer, for the reason that, in real life, the people who ask the most questions questions never listen to the answer. They ought to be made to do so if it were not so much trouble. The only weapon against the aggressive mode of questioning is to insist on your right of reply, in spite of the shifts, evasions, and writhings of the impatient questioner caught in the snare of his own setting.
Update (April 22, 2023)
I did some further searching and turned up this instance from a re-examination of J. B. Hughes by Mr Kay on August 22, 1877, in Proceedings of the Parliament of South Australia, volume 3 (1877):
[Mr. Kay:] Then the Committee undersstand that you absolutely refuse to give them the name of your informant?—[Mr. Hughes:] I do; ever since you have had Responsible Government the duration of ministries has only averaged eight months, and Mr. Boucaut my be in office again immediately. That reason was given to me by the person who gave me the information. The Committee asked me whether anything had occurred between me and Members of Parliament. I answered the question loyally and concisely. If you did not want my answer, you should not have asked the question. If you do not like to publish my answer, withdraw your question, and my answer will go too. I did not volunteer the information.
It's often attributed to James Thurber, an American cartoonist, humorist, and author. Thurber is known for his wit and satirical commentary on society, which has made him a popular source of humorous quotes and anecdotes. However, it is not clear which specific work of Thurber the quote is taken from. Some sources simply credit him as the author without providing a specific reference. I remember this from a college Statistics class, when the professor was talking about surveys and the publication of their data.