In which layer of earth are gold and metals are present?
Of the more than 100 elements of the periodic table, the majority are metals. So, metals are found in all layers of Earth's structure.
The eight most common elements in Earth's crust (by mass) are:
Oxygen (O) 46%
Silicon (Si) 28%
Aluminum (Al) 8%
Iron (Fe) 5%
Calcium (Ca) 3.6%
Sodium (Na) 2.8%
Potassium (K) 2.6%
Magnesium (Mg) 2%
Together, oxygen and silicon make silicon dioxide, the building block of silicates (a very large class of minerals). The rest of the elements listed are metals. As you can see, precious metals such as gold, silver, and platinum are not abundant. Currently, South Africa is estimated to be the world's largest producer of gold. The U.S. and Brazil also have large gold resources.
In a 2006 issue of the highly-respected science journal Nature, Professor Bernard Wood of Australia presented calculations that show that 99% of Earth's gold is located in the core. This occurred during Earth's formation, when it was entirely molten and heavy elements such as iron sank to the center of Earth, leaving light elements such as oxygen and silicon to "float" on the surface and eventually solidify into the crust and mantle.
The mantle, the thickest layer of Earth, is made of essentially the same elements as the crust but with higher percentages of heavy elements such as iron and magnesium.
The outer and inner cores are both made of mostly iron with a little bit of nickel (Ni), but the outer core is "liquid" and the inner core is solid.
The simple answer here is: all of them. However, if you are expressly wondering about solid pieces / nuggets / flakes / veins of gold, you will find most of that in the lithosphere, because that is a solid layer - and also the only layer we can truly access.
Gold is not a very common mineral, actually. Still, trace amounts of gold can be found in magma, in sea water, even in river beds.
How much gold is in layers other than the lithosphere is conjecture, but our current understanding of the early earth says that when the earth was more uniformly molten the "heavier" minerals "sank" into the center (a process called differentiation). Mostly this is iron, but it is entirely plausible that whatever gold was around at that time may well have "sunk into the core" as well, due to its high specific gravity (this means that it is heavy relative to other minerals).