In fact, fingernails and toenails can be said to be related to talons and claws, but unlike talons and claws, they are not vestigial that serve any particular purpose, but they do serve some purposes anyway.
As you might have noticed severally, animals that have nails rather than claws tend to grasp objects such as woods and branches. Nails grew in a way that it enables the hand to grab objects without causing any obstructions. Grab any object near you now, but don't grab any fragile object, and make sure you apply some pressures. You will notice a reciprocation of that pressure at your nail tips and behind the nails. In the absence of those nails, repeated grasping would have resulted in the splitting and ripping of the back of your fingers due to the applied pressure. As you know, it is very bad to have the tips of your fingers splitting apart gradually, so nails are very good things.
Now you may be wondering what good the toe nails serve, though we never grab anything using our feet, plantigrade is the fancy term, and they are just fine. Toenails, as a matter of fact is vestigial in our case, but when you consider our evolutionary ancestors and our closest primate relatives, you will agree that they are not vestigial after all. Several other primates can make use of their feet to grasp, and toenail serve the same purpose with your finger nails since they are located on your feet.