What should a writer do if s/he wants to use a quote, but the quoted sentence seems to contain a grammatical error? Should the writer correct the error when including the quote?
Quotes (that is, quoted text) must be taken as they are found. They should not be corrected, and usually errors should not be pointed out, unless they are significant to the reason why the quote is being used.
To indicate that a possible error was in the original and not a typo by the person doing the quoting, add "[sic]" after the error. This is Latin for "so" and means that the version quoted was that way in the original. If you fear that the Latin will not be understood, use "[thus in the original]" or some similar phrase. The square brackets are a common indicator that something is begin added that was not present in the original quote, at least not in exactly this form.
If the error affects the meaning of the quote, or was important to how the quote was understood, and this is relevant to the use you are making of the quote, it can be pointed out and discussed in the associated text, which will normally be outside of the quote itself.
Here is an article from Merriam-Webster explaining the use of sic in more detail. This was brought to my attention by user J.R.
In addition to David's answer, there is also the matter of different style guides and what changes to a quote they say is permissible.
I remember trying to quote an important statement, but the original author left some words out (and it annoyed me) that needed to be there in the sentence. And so I asked a somewhat related question in Academic SE: Can you add nouns/adjectives/articles in a direct quotation in Chicago MoS keeping the message intact?
The 17th edition Chicago Manual of Style guide (CMoS) says "although in a direct quotation the wording should be reproduced exactly, the following changes are generally permissible to make a passage fit into the syntax and typography of the surrounding text." - 13.7
CMoS says "obvious typographic errors may be corrected silently (without comment or sic; see 13.61), ... If spelling and punctuation are modernized or altered for clarity, readers must be so informed in a note, in a preface, or elsewhere."
CMoS also says that we can occasionally use square brackets "to integrate tenses and pronouns into the new context... This device should be used sparingly, however." - 13.12
Example: Mr. Graham has resolutely ducked the issue, saying he won’t play the game of rumormongering, even though he has “learned from [his] mistakes.”
We can use square brackets to insert additional materials into the original quote "to clarify an ambiguity, to provide a missing word or letters..., to correct an error,..." - 13.60
If certain words in the original quote are "missing or illegible, an author may use ellipses, a bracketed comment or guess (sometimes followed by a question mark), or both." In such cases, we have to explain their use in the text. - 13.59
She marched out the door, headed for the [president’s?] office.
As David says, [Sic] can be used "following a word misspelled or wrongly used in the original. This device should be used only where it is relevant to call attention to such matters (and especially where readers might otherwise assume the mistake is in the transcription rather than the original) or where paraphrase or silent correction is inappropriate" - 13.61
Edit 1: Perhaps someone can talk about the other style guides. This whole thread/question would then be a great resource for anyone who is struggling with the issue.
Edit 2: Oh, MLA seems very strict about silently changing capitalization. Here is a summary of the permissible changes to original quotations under the major style guides: Shhhhh: Silently Altering Quoted Material.
Edit 3: I had previously asked a somewhat related question in Academic SE: Can you add nouns/adjectives/articles in a direct quotation in Chicago MoS keeping the message intact?