[W]hat are [these] brackets for?

I must have slept through this in school. I can’t remember what these signify in writing. [L]ike on the first letter. Or on a [word].

Generally they indicate an editorial interpolation.

For example, a quotation extracted from the middle of a sentence and presented as a quote would generally need to capitalize the first word in the sentence. However, since the text in the original was from the middle of a sentence, it was not capitalized. In order to follow the standard syntax, the first letter is capitalized, but it is then enclosed in square brackets to show that an editor has tampered with the exact quote.

Consider the sentence “Following the last war, the troops were sent home with no pay.”
If “the last war” is clearly understood within the context of the article, a person might simply quote:
“the troops were sent home with no pay.”
however, this is grammatically incorrect, since it is a complete sentence in which the first word is not capitalized, so it would probably appear in an essay as:
“[T]he troops were sent home with no pay.”

Similarly, a misspelling will be reproduced in a quotation without correcting the error. However, to let the readership know that the error occurred in the original and was not the fault of the person quoting a source, the misspelled word will be followed by the notation “[sic].” In Latin, sic means “thus” and it appears in the text as an indication that the quoter found the word spelled thus.

I think sic usually appears in parentheses, e.g. (sic).

Another use for square brackets is for adding information to a quotation which might be lost out of context. For example, consider the sentence “I know Bob and he’s a super hoopy frood.” In the context of that conversation, everyone probably knows who Bob is, but if you were quoting it out of context, you might write: Cecil said, “I know Bob [Smith, Secretary of Keepin’ it Real] and he’s a super hoopy frood.” Then everyone knows that Cecil was talking about Bob Smith.

This method is used in journalism a lot. For instance, if a reporter interviews a coach, the coach might give a quote in the middle of the interview that a reporter wants to use in the beginning of a story. Thus, if the coach was talking about Smith for a while and then says “He is a really good rebounder,” where the reporter uses the quote it might not be clear who the coach would be talking about. Thus, the reporter would write, “[Smith] is a really good rebounder.”

[Sic] Semper [sic].

Sometimes the verb has to be altered to match the subject of the narrative:

Bob: Bill, Sue and Jim were raised right.

Jim, though, has reportedly gunned down a busload of nuns.

Newspaper report: “Jim [was] raised right,” stated Bob, a family friend.

I know you asked about writing, so this doesn’t answer your question at all, but I just thought for interest’s sake I’d add that “square” brackets are used in several computer programming languages to signify an index into an array (e.g., myArray[4] would reference the fifth item in a zero-based array called myArray).

Whee!

I like this technique, especially in interviews. I was reading an interview a while back with Rush guitarist, Alex Lifeson. Just by the way it read, it was apparent that either the whole interview — both questions and answers — was scripted, or that the publisher rewrote or paraphrased Alex’s answers. Why did it seem that way? Well, because Alex referred to his bandmates by their full names. “So I was talking to Geddy Lee and Neil Peart the other day, and …”

It felt very unnatural. Usually, when a musician is being interviewed for a music magazine or Web site, it’s assumed that the interviewer has at least a passing knowledge of the names of the band members, and that the reader will also know this information. So when Alex used his bandmates full names, it felt fake. Square brackets would have been useful: “So I was talking to Geddy [Lee, Rush’s bassist/keyboardist/vocalist] and Neil [Peart, drummer and lyricist] the other day and …” It would have made Alex’s speech sound more natural, while at the same time providing context for those readers who might not be familiar with the band.

Well, if we’re going to get into technical usage, it also has some sort of use or another in a few obscure bulletin board systems…

Usually it does. But that’s because so many people do it wrong. Correct usage is within square brackets.