The principle necessary to answer this question is the conservation of linear momentum. This means that the sum of the momentum of the hammer and nail before impact must be equal to the total momentum of the system after impact. We want to equate momentum before and after impact. Using the fact that momentum is equal to mass times velocity, and putting all quantities into SI units:
0.0070 + 0.2510 = (0.007+0.25)*v
Once we rearrange for v, we get the result that v = 9.7 ms^-1 as the momentum of the hammer and nail after impact.