According to the Bronsted-Lowry definitions, an acid is any substance that donates hydrogen ions; whereas, a base is any substance that accepts hydrogen ions.
In the first reaction, water is acting as an acid because it donates a hydrogen ions.
In the second reaction, water is acting as a base because it accepts a hydrogen ion.
In the third reaction, water is again donating a hydrogen ion so it is the acid.
In the fourth reaction, water is acting as a base by accepting the hydrogen ion from the ammonium ion.