The ancient Greeks and alchemists thought that fire was itself an element, along with earth, air, and water. However, the modern definition of an element defines it by the number of protons a pure substance possesses. Fire is made up of many different substances, so it is not an element.
For the most part, fire is a mixture of hot gases. Flames are the result of a chemical reaction, primarily between oxygen in the air and a fuel, such as wood or propane. In addition to other products, the reaction produces carbon dioxide, steam, light, and heat. If the flame is hot enough, the gases are ionized and become yet another state of matter: plasma. Burning a metal, such as magnesium, can ionize the atoms and form plasma. This type of oxidation is the source of the intense light and heat of a plasma torch.
While there is a small amount of ionization going on in an ordinary fire, most of the matter in the flame is a gas, so the safest answer for "What is the state of matter of fire?" is to say it's a gas. Or, you can say it's mostly gas, with a smaller amount of plasma.
Different Composition for Parts of a Flame
The structure of a flame varies, depending on which part you're looking at. Near the base of the flame, oxygen, and fuel vapor mix as unburned gas. The composition of this part of the flame depends on the fuel that is being used. Above this is the region where the molecules react with each other in the combustion reaction. Again, the reactants and products depend on the nature of the fuel. Above this region, combustion is complete, and the products of the chemical reaction may be found. Typically this is water vapor and carbon dioxide. If combustion is incomplete, a fire may also give off tiny solid particles of soot or ash. Additional gases may be released from incomplete combustion, especially of "dirty" fuel, such as carbon monoxide or sulfur dioxide.
While it's difficult to see it, flames expand outward like other gases. In part, this is hard to observe because we only see the portion of the flame that is hot enough to emit light. A flame isn't round (except in space) because the hot gases are less dense than the surrounding air, so they rise up.
The color of the flame is an indication of its temperature and also the chemical composition of the fuel. A flame emits incandescent light, where light with the highest energy (hottest part of the flame) is blue, and that with the least energy (coolest part of the flame) is redder. The chemistry of the fuel plays its part. This is the basis for the flame test to identify chemical composition. For example, a blue flame may appear green if a boron-containing salt is present.