Formal:
* Formalist
* Purist
* Stickler
* Dogmatist
* Nitpicker
* Hypercritical
Informal:
* Grammar Nazi (often humorous or satirical)
* Know-it-all
* Show-off
* Smarty-pants
* Quibbler
* Hair-splitter
More negative connotations:
* Pretentious
* Arrogant
* Snobbish
* Ostentatious
* Supercilious
The best word to use will depend on the specific context and the level of formality you want to achieve.