Beware the Diglossia!
'You may talk like this, but you may not write like this'. This sentence gives us a picture of the way some natural, spontaneous forms are banned from the written language. Not writing 'gonna', or 'ain't' at your school paper is something you take for granted, but, if in English the distance between the formal and the informal varieties is somewhat close, in some other languages even the most educated speakers employ different words, verbal conjugations or a whole different syntax in their ordinary conversations and in their texts. The fact of having two varieties of the same language - a formal one, usually written and conservative and an informal one, with several innovations when it comes to declensions, conjugations, word order and vocabulary - is what linguists call 'diglossia'.
Language-learners may be aware of the 'issue' of diglossia if they really want to live the atmosphere and embrace the culture related to the language they are learning. Some languages and countries are well-known for their situation of diglossia: Tamil, in Southern India and Sri Lanka; Standard Arabic and its dialects; Swiss German and Standard German. Nevertheless, there are several other languages that experience diglossia to some extent which is often neglected by language courses, and this causes foreign learners to come up with clumsy, out-of-context 'bookish' sentences. Notable examples are Czech and Finnish, but also Portuguese in Brazil and French.
Let us examine the case of Brazilian Portuguese a bit closer. The language evolved apart from its European origins for over five centuries and underwent several changes in lexicon, morphology and syntax. The written language, though, remained fairly conservative. Perhaps the most remarkable example of this process is the position of the pronouns in a sentence. The most natural order for European Portuguese is after the verb: 'Fale-me a verdade. (='Tell me the truth'), and this is also the way Brazilians should write . In spoken language, though, it is more common to say and hear 'Me fale a verdade' in Brazil. So, a Brazilian really has to think differently before writing and before speaking, and that is what diglossia accounts for.
More on word order: in the spoken language, the interrogative pronoun is usually placed at the end of a sentence, instead of the beginning, as the end of a sentence tends to carry its focus. So, instead of a bookish 'O que você está fazendo?' (=What are you doing?), you will most often hear 'Você está fazendo o quê?' in Brazilians' conversations.
A further example is the disappearance of any plural markers that aren't strictly necessary. That is, instead of making all necessary nouns plural and conjugating the verb accordingly, Brazilians may "eat up" some s' and even ignore the plural verb conjugations. This usage is much less frowned upon, though, and the learners are better off with pluralizing nouns and adjectives equally and conjugating verbs equally. Consider these four different ways of expressing the same sentence 'The boys are playing with the toys': 'Os meninos estão brincando com os brinquedos/Os meninos 'tão brincando com os brinquedos/'Os menino 'tão brincando com os brinquedo and Os menino 'tá brincando com os brinquedo'. Even though you may hear any of these four forms - and sometimes the same speaker may use one or another freely, for example, they may use the 2rd and the 3th interchangeably at the same informal context - as a foreign speaker you are better off with the 1st form for writing and the 2nd form for speaking informally.
As can be seen from above, the spoken language in Brazil is not a "corrupted" version of formal Portuguese grammar. Is is a rather unique variety, with its own rules. What is most remarkable is that those rules apply to essential topics such as word order and conjugations. it does not mean, though, that the learner should study two completely different languages. It rather means that, if the learner pays attention to some important details, they will find themselves better adapted to the different social contexts at which the language is used. Fortunately, the newest textbooks for Brazilian Portuguese tend to present the differences between the formal and informal language in a consistent way and thus allow the learners to use both varieties consciously.