Some chemicals have similarities that can group the chemical with similar chemicals, but each chemical has several distinguishing characteristics. By looking at the chemical's characteristics, a chemist can identify the chemical. The process is called qualitative analysis.
The oldest form of qualitative analysis is a physical examination of physical and chemical properties, color, smell, density, melting point, boiling point and common reactions. Even taste has been used in the past, but tasting unknowns is discouraged in the profession. Copper compounds are often green or blue. Thus if I am handed a blue crystal, I suspect it is a copper compound. A good chemist will often identify some compounds by smell alone because the smell may be characteristic, such as acetic acid or vinegar. Density or specific gravity is important. Gold can be easily separated from other yellow materials because gold is so dense. Melting point is useful in identifying organic compounds. Boiling point can help identify liquids.
The properties easily observed with a minimum of lab work may give a chemist suspects, but seldom give the chemist an exact identification. Classically, chemists looked at common reactions of chemicals. A group of similar chemicals will have one or more simple reactions in common. For example, any acid when added to a solution of sodium carbonate or sodium bicarbonate (baking soda) will cause the solution to bubble with carbon dioxide bubbles. Over the centuries, systems of qualitative analysis have been developed that exploit such reactions. For example, solutions containing gold, silver or lead(I) salts all form precipitates when a few drops of hydrochloric acid is added. The chemist can then run tests that distinguish between gold, silver and lead. Similar protocols exist to identify most inorganic and organic compounds.
In the past century, instruments have been developed to assist with chemical identification. Chemicals take on a color because certain wavelengths of light are absorbed when they pass through the chemical. This phenomenon exists even at wave lengths outside of the spectrum visible to the human eye. It is the pattern of electrons within each atom that results in light absorption. Often chemical bonds modify the absorption wavelength. Spectroscopy allows the chemist to look at the patterns of light absorption. Often the pattern given by a chemical during spectroscopic analysis is as characteristic as a criminal's finger print.
Various instruments have been developed to measure molecular mass. Not only is it possible to see how much a molecule weights, but the mass spectrometer actually splits complex molecules into fragments and records the molecular mass of each fragment. The chemist can then piece together the fragments.
Classical analytical chemists looked at the visible physical properties of a material along with common reactions of the chemical. The process works, but is often time consuming. Modern instrumental analysis exploits properties that may not be so easy to observe. Some instruments look at the properties of the nucleus of atoms. Some look at the patterns of electrons in the electron cloud of an atom. Some even make an analysis based on the direction electrons are spinning. Measurements of radioactivity can help in the analysis of radioisotopes. While the classical methods looked at chemical reactions, the analytical instruments all look at energy interactions related to the atomic or electronic structure of the chemical.