Is it correct to use zero article before 'mechanic' and 'hairdresser' in this sentence?
Is it correct to not use an article before the occupations in this sentence?
Two 18-year-olds, Ron Smith, mechanic, and George Major, hairdresser, were arrested yesterday.
Yes. This usage treats their occupations as titles and is common in journalism where words equal page space.
The lack of spaces after the commas is incorrect.
Depends where the sentence is. It's newsreader concise. If it was in the New Yorker, they'd add a "a". ;-)
You're trying to use an appositive. Typically, you'd use an article when the appositive follows the proper noun, but you wouldn't use one when the situation is reversed:
Here are four variations (with spaces added after the commas, a convention not subject to debate):
Proper noun as appositive; note the article before the profession: Two 18-year-olds, a mechanic, Ron Smith, and a hairdresser, George Major, were arrested yesterday.
Profession as appositive with article: Two 18-year-olds, Ron Smith, a mechanic, and George Major, a hairdresser, were arrested yesterday.
Your example: Profession as appositive without article, but I would argue that, without the article, the uses here are best viewed as adjectival, in which case they are indeed permitted: Two 18-year-olds, Ron Smith, mechanic, and George Major, hairdresser, were arrested yesterday.
Adjectival profession, standard form and actually more concise: Two 18-year-olds, mechanic Ron Smith and hairdresser George Major, were arrested yesterday.