A rock is formed from magma that penetrated the Earth’s crust as lava and cooled quickly to produce small crystals. What type of rock is it?
Broadly speaking, there are three types of rock: sedimentary, igneous, and metamorphic. Here’s a rough diagram of how the various rocks are formed. Sediment, largely produced by erosion, is compacted into sedimentary rocks. Igneous rock forms from cooling magma. Meanwhile, rock far below the Earth’s surface is converted to metamorphic rock by high temperatures and pressures. The rock in the question was formed from magma. So we know that it’s a type of igneous rock.
However, there are two types of igneous rock: extrusive and intrusive. Extrusive igneous rock is made from lava. Lava is magma that breaks through the Earth’s crust, for instance, in a volcanic eruption. Intrusive igneous rock is made from magma that cools below the Earth’s surface. Pockets of magma can form that are cooled by the surrounding rock but are not in contact with the air outside.
So extrusive rocks generally form under fast cooling conditions, while intrusive igneous rocks formed under slower cooling conditions. Faster cooling means smaller crystals. The rock in the question formed from magma. So we know it’s an igneous rock. It penetrated the Earth’s crust as lava and cooled quickly to produce small crystals. So we know the type of rock in the question is extrusive igneous rock. Examples of igneous rocks include basalt, obsidian, rhyolite, and andesite.