I do not want people to think that, every time I write about grammar, it is another rule to learn. Often it is a rule not to teach. Some teachers, whose own English is poor, teach bad rules (native speakers included). It is easier for students to not be taught extra stuff that is not real. Here is another garbage rule that should not be taught.
Garbage rule: 'can not' is wrong and should be written 'cannot'.
All three forms (can not, cannot and can't) are correct, according to all the best reference books and dictionaries.* Please don't cause students extra work by giving them an extra garbage rule to learn.
Some people prefer one form or the other. In UK English 'cannot' is more common (three times as common). In US English 'can not' is more common (about a thousand times as common). However both are correct in both countries. The modern UK version is not the original; the original is 'ne cunnan', a spelling (and grammatical structure) not used for hundreds of years. Some people claim that the negative form of the verb 'can' is only the single word 'cannot'. This is not true. Originally the form was two words and the word 'cannot' is a compound word formed by 'can + not'.
There are some times when 'can not' is a better choice. You would use 'can not' when the ‘not’ is also associated with the next word, such as 'not only.' In this structure the object of the sentence does an action, and also does it much better than expected.
Thus, the presence of males in the peer group can not only make deviance more socially permissible, but the likely context of this socializing can also provide more opportunities for deviant behaviour.
(The Oxford Handbook of Criminological Theory, page 302)
Thankfully London has plenty of galleries where children can not only go for inspiration, but also have a go at making a masterpiece themselves.
(Take the Kids: London, page 24)
Children can not only survive state social studies - they can thrive!
(California Survivor, page 4)
Another common reason to use 'can not' is for emphasis. When speaking the word 'cannot' is stressed on the first syllable of the word. The words 'can not' are stressed twice. So if you want to stress that something is NOT ALLOWED use 'can not'.
Miss Wong said, "No you can not bring the stray dog into the classroom."
Mother said, "Tommy, you can not climb down twenty floors from our flat."
"You can not be serious," yelled John McEnroe.
The word can't is a contraction of can not. Contractions are not commonly used in more formal writing, such as invitations, laws, contracts, job applications and so on. Contractions are not wrong, but they are a style choice.
Be careful not to use cant. This is not a spelling mistake, but two different and unrelated words. The first word cant refers to a type of slang used to hide the speakers meaning from outsiders. Thieves often use special slang words to prevent people from realising that a crime is about to be committed. Business people sometimes use this type of slang to conceal wholesale prices from customers. (It also means hypocritically pious speech.) The second meaning is to 'tilt something' or to 'set something on an angle'.
Contractions are not wrong, but are a style choice. In the same way using can not or cannot is a style choice. If your teacher insists that can not is wrong, just play along until after class. Then forget the garbage rule. In some jobs one style or the other is required. Use the style your boss wants, but understand that other style choices are not wrong. For example a quick search of Hong Kong laws shows that only the form cannot is used. If you are using British spelling, the form 'cannot' is preferred, but 'can not' shouldn't be marked wrong. The form 'can not' is preferred in structures such as 'can not only'. The form 'can not' can also be used for emphasis, especially when speaking. Don't teach that an easy to understand structure is wrong and make English more difficult.
The A to Z of Correct English , by Angela Burch, page 32
The New Fowler's Modern English Usage, page 126
Note: All these references are from the UK.
COCA, the Corpus of Contemporary American English, shows that 'can not' is used in preference to 'cannot' in American English by 67, 373 to 67. The form 'canot' is rare at 10 insistences. According to the Oxford English Corpus the form 'cannot' is three times as common as 'can not' in British English. (www.oxforddictionaries.com/definition/english/cannot)