What proof do you have that planets are made from gas and dust?
The main way we study what planets are made of is by looking at their birthplaces around other stars. Planet formation happens in what are called “protoplanetary disks”. These protoplanetary disks are made of material leftover from the formation of the central star. Stars collapse from giant molecular clouds made from mostly gas and a little bit of dust (about 100 times more gas than dust), and thus these disks, and eventually the planets which form inside them, are made from the same material. We can confirm the two components observationally by looking at the thermal (heat) emission from the dust and the line emission from the gas.
Thermal, or black-body, radiation is the type of emission given off by all opaque objects and is characterized, both in its spectrum and total intensity, by the temperature of the object. This is the type of light given of by an incandescent light bulb or the heating element in an oven. Hotter objects are brighter and bluer while cooler objects are fainter and redder. We often refer to this kind of emission as the “continuum” because it is smooth as a function of wavelength. Diffuse gas, on the other hand, gives off light only at specific wavelengths that are determined by the quantum mechanical structure of the atom or molecule. Since this emission is only at specific wavelengths we call it line emission (or absorption). Every day examples of this are neon signs and sodium or mercury vapor lights. You’ll notice that certain colors look really weird under these lights because the light’s spectrum has large gaps between the lines.
Using these two types of emission we can investigate protoplanetary disks. We can determine the disk’s temperature and density structure, the sizes of dust grains, the amount and location of different types of gasses and even identify signatures in the structure of the disk which may indicate the presence of planets. Since the gas line emission is at a specific wavelength, we can also use the doppler effect to measure the velocity of the gas in the disk. Most of these observations are made at infrared and radio wavelengths where the cool dust and gas emit most of their light and where the central star is relatively faint. One of my research projects is actually studying the gas emission from one of these disks using an exciting new radio telescope in Chile called the Atacama Large Millimeter/submillimeter Array (ALMA).
So to sum up, we know that planets are made from gas and dust because we detect line and thermal emission from the gas and dust in the birthplaces of planets: protoplanetary disks. An active area of research is to determine the physical processes behind how this gas and dust clumps to form planets. For more information on that you can check out this askanastronomer post about planet formation.