Your question mostly turns on the definition of grammar.
From a linguistic point of view, grammar is simply the set of patterns and rules that speakers use to structure their utterances. Grammar is absolutely necessary for communication. A sentence with literally no grammar cannot be understood, and a sentence that abuses grammar will be understood the wrong way. Here's a no-grammar sentence:
Collar dog brown the wear cat bite the.
You have no idea what this sentence means, though you could probably make a guess at what it might mean if you rearranged the words. It's just an unstructured collection of words. Without grammar to establish the relationships between those words, the utterance is incomprehensible. But if we add some grammar:
The dog bit the cat wearing the brown collar.
Now you know exactly what it means. The grammar of English tells you to put the word the right before a noun, tells you to turn wear into wearing, and to put the word brown before collar to indicate that it's the collar that's brown, and not the dog or the cat. These sorts of rules and regularities are what we mean by the word grammar.
Slang absolutely has grammar. Let's rewrite this sentence in a different dialect:
Some dog gone bit that there kitty, and he don't take that from nobody.
This is an example of nonstandard grammar. Different dialects and different registers of English have different grammatical rules. Some of those rules are accepted and encouraged as proper, and this constitutes what we call "standard English". Some of those rules are not widely accepted, and those constitute "nonstandard English". It's important to understand, however, that a nonstandard dialect doesn't have "no grammar", or even "bad grammar". The sentence that I wrote follows all of the grammatical rules for that dialect and register. It's just nonstandard grammar. And even then, there are a relatively small number of grammatical differences between the nonstandard sentence that I gave above and a standard translation, which is why it's not really very difficult to understand both of them.
So we have to have grammar to communicate, but do we need standard grammar? If our goal is simple comprehension, then no. The main reason to use standard grammar is social: people think more highly of someone who knows how to use standard grammar, and nonstandard grammar is often taken as a sign of poor education or low intelligence. This is often a false assumption, but nonetheless the assumption exists, and it's to your benefit to know how to use and acquire standard grammar so as to present the best possible image of yourself.
(Aside from grammar in the sense discussed here, written language encompasses other conventions such as spelling and punctuation. These are sometimes lumped together as "grammar" as well, though really they should be considered separate issues. The same remarks about the importance of standard grammar apply to the usage of standard spelling and punctuation.)
Finally, we come to the issue of language change. All languages are constantly changing, but whenever a new word or grammatical construction comes into use, it begins life as nonstandard. This doesn't mean that it's "not a real word" or that you shouldn't use it—it just means that the standard grammar hasn't yet accepted it. In situations where standard grammar isn't required, there's nothing wrong with using slang, double-negation, or other features of nonstandard grammar. Typically, if these nonstandard usages persist, they will eventually become part of the standard.