A razor is currently a useless item, and often considered as junk.
A razor has no use, being added purely for the purpose of clutter, creating more realism for the player when looting. Facial hair cannot be shaved with this item.
Razors are most often found in medicine cabinets and bathroom counters, though they very rarely spawn as loot on the corpses of zombies.
From newitems.txt (Project Zomboid directory/media/scripts/)
Weight = 0.2,
Type = Normal,
DisplayName = Razor,
Icon = Razor,
MetalValue = 5,