It's a popular notion that pounding copper nails into the roots or trunk of a tree can kill it. While it seems to make sense since copper can be toxic, it's more myth than reality.
Though it's true in theory that with enough copper nails you could eventually kill a tree, in practice it would be impractical and expensive. It's better to opt for other methods.
Instead of using a hammer and copper nails, simply cut down the tree, have it professionally removed, or girdle it. These options are far more reliable and also herbicide-free.