A metal can only be identified by its density if it is chemically pure. Alloys, which are combinations of metals, cannot be identified solely by density.
If it is known that a metal is made of a single element, such as solid aluminum, this can be verified by measuring its density. It is also possible to make a precise estimate of how pure the metal is if there is a single other element mixed with the original element. For example, if the sample is known to be rose gold, it is possible to judge its percentage of copper solely by measuring its density.
However, density alone cannot identify how much of three chemical elements is in a given sample. Gold mixed with a certain amount of silver has the same density as gold mixed with a different amount of copper. Attempting to identify an alloy by density is only appropriate if it is known to be a commercial alloy that has a set, unique density. Even then, the density does not reveal how the alloy was made. Hard and soft carbon steels may have extremely similar densities, being made of the same proportions of the same atoms, but critically different strengths, as the atoms are in different configurations.