Every year I have a student who likes to ask me if I know that ain't is a word. Let me play it out for you...
STUDENT: "Mr. Jon, did you know that ain't is a word?"
MR. JON: "Not in here it isn't."
STUDENT: "It is too. Look it up in the dictionary."
Let us stop there. Now I like to question authority as much as anyone, but I have to say, these kinds of exchanges depress me.
There is a distinction between the language you speak with your friends and the language you speak with someone in a position of authority (parents, grandparents, bosses, teachers, clergy, law enforcement, etc.) If there is not, there should be.
It is appropriate for dictionaries to include words that include slang (though typically, by the time they make it into the dictionary the words are no longer in the vernacular). Some words (slang) are not words that are appropriate for use in formal writing.
So what type of words should you avoid?
Any words that abbreviate, or are not very specific I would generally avoid. For instance:
In your formal writing I would also advise you to avoid the use of contractions. It makes your writing look a little more formal, and it has the added benefit of being longer.
So, back to our little exchange from earlier. I am an English teacher. It is my job to expect/correct/teach students' use of Standard American Edited English (SAEE). Anything else, no matter how invasive/omnipresent/frequent in formal writing, is incorrect. Now, if you want to write dialog then pretty much anything is fair game...as long as it is punctuated properly, but I'll save that for another post.