In this case we don’t know who it was… but good-old nails were invented by someone in the 1860s. It wasn’t really the nail itself that was invented but the machine to make them.
You see, nails go back thousands of years, but for most of that time they were hideously expensive because each one was made by hand. Imagine making all the nails required for a house by hand! They were cut or forged or hammered into shape. The process of making enough nails for a house could take weeks or even months. At some point in the 19th century the idea began to take shape that you could make nails out of a long coil of steel wire, but first you had to invent a way to make a long coil of steel wire!
Just think about it for a second. Imagine if hitting that nail the wrong way meant that you had to spend 10 minutes making another one. Holy guacamole!
It really wasn’t until about 1910 that nailmaking became as cheap as it is today, with the process for making steel wire, cutting it to length, cutting one end into a point and pressing the other end flat taking mere moments thanks to electric and hydraulic equipment. All of a sudden you could make thousands of nails an hour!
It’s been pointed out (no pun intended) that the old-school square nail is actually far superior to the round one, but for most of the 20th century it was simply too expensive to make square-edged nails. Round nails do a great job and there isn’t a lot of reason to go to a square nail at this point.