Test for sulfate ion:
In order to test if the solution contains the sulfate anion (
The precipitate is
The reaction occurring is:
The reason you must add an excess of dilute hydrochloric acid is that other anions such as sulfite and carbonate will also give a precipitate but these will dissolve in the acid whereas sulfate will not.
To test for the presence of ammonium ions you add a few ml of 1M sodium hydroxide solution and warm gently. Ammonia gas is given off. You can test it with moist pH paper which will turn blue. It should also give the characteristic pungent smell (care!).
The reaction is :
Here is a video on how to test for other anions, such as nitrate, carbonate, thiocyanate, fluoride and chloride.