Quoted from Atari_Daze:Mark Twain ~ "Better to remain silent & thought a fool than to open one's mouth & remove all doubt."
Just Saying, since there are teachers in here:
https://www.npr.org/2017/04/04/522581148/hemingway-didnt-say-that-and-neither-did-twain-or-kafka
On the origin of the quote "Better to remain silent and be thought a fool than to speak and to remove all doubt," which has been wrongly attributed to both to Abraham Lincoln and Mark Twain
The earliest evidence that I was able to find was a 1907 book by Maurice Switzer. And it seems to contain a lot of original material and it includes the statement "It is better to remain silent at the risk of being thought a fool, than to talk and remove all doubt of it." So it's slightly different phrasing, but I believe that is what evolved to generate the modern common version.