Garlic is one of the few bulbs that has an important role to play in horror literature.
Why? Because it repels vampires, which is really useful when you're stuck in a world full of them and not much else. So Robert Neville, the lone survivor of a horrible plague that has turned everyone else into a vampire, has got used to living surrounded by garlic. He reeks of it, but he cannot smell it any more. He has adapted to it, just as he has adapted to a world in which his opinion is the only one to matter. Therefore, who cares if he stinks, or if he kills vampires, or himself? He must satisfy his own moralistic sense, and not the readers'. Therefore, it's inevitable that we look at some of his behaviour from a distance, and find ourselves disagreeing with his choices by the end of the novel. He does not live in a normal world, but one that he endeavours to keep normal by exercising principles of science and fair play that no longer exist.
This is most obvious when he experiments with the garlic.
'He jiggled one of the pink leathery cloves in his right palm. For seven months now he'd strung them together into aromatic necklaces and hung them outside his house without the remotest idea why they chased the vampires away. It was time he learned why.
'He put the clove on the sink ledge. Leek, onion, shallot and chive. Would they all work as well as garlic? He'd really feel like a fool if they did, after searching miles around for garlic when onions were everywhere.'
Is it ridiculous to think onions might have the same effect? It makes me smile, as a reader, because I'm surrounded by the weight of horror literature on the subject. I don't know why garlic works; it just does. And an onion isn't going to cut the mustard. But Robert Neville has been cut free from such knowledge. He is a lone experimenter in a terrible world that makes no sense. A world in which there's going to be no room for garlic.
Here, the garlic represents the past, the familiar, all that must be looked at afresh. We smell the garlic, although he does not.