Ask a silly question and you'll get a silly answer
This sounds like a fairly recently coined proverb and, in it's precise wording, it is. Nevertheless, a mediaeval version with almost exactly the same sentiment written in Middle English predates the modern version by a good 500 years. William Caxton expressed the notion in his retelling of Aesop's Fables, 1484:
For to a folysshe demaunde behoueth a folysshe ansuere.
The modern translation had to wait until the 20th century, as in this example from the Minnesota newspaper The Brainerd Daily Dispatch, Tuesday, April, 1945:
If you want to ask a silly question and get a silly answer, just ask Mona Roth whom she refers to as El Dorado.
See more 'Silly' phrases.