Answer: Compound
Explanation:
Element is a pure substance which is composed of atoms of similar elements.It can not be decomposed into simpler constituents using chemical reactions.Example: Copper 
Compound is a pure substance which is made from atoms of different elements combined together in a fixed ratio by mass.It can be decomposed into simpler constituents using chemical reactions. Example: water 

Thus as it give that the red sample on being heated, a gas is released and a blue powder is left after the heating. Thus the given sample is a compound.
You should read up on Proust's law, better known as the Law of Definite Proportions. This is a chemical law that defines your question more generally, on why the ratio of elements and ions are always fixed.
Basically, this compound Magnesium(II) Chloride is MgCl2 because it has the same number of protons, neutrons, and electrons all the way. This defines the properties of the compound or atom.
Mol sulfuric acid = 19 g * (1 mol) / (98.1 g) = 0.19367 mol
mol H2O = 0.19367 mol H2SO4 * (2 H2O) / (1 H2SO4)
= 0.387359 mol H2O
grams H2O = 0.387359 mol H2O * (18 g)/(1 mol)
= 6.97 g
The answer is 7.0 grams of water