Answer
By donating the proton bonded to nitrogen, it can act as an acid. And since ammonia has nitrogen which has a lone pair of electrons which can accept a proton, it can act as a base. It acts as a base in water.
Work Step by Step
Acid is any species that can donate proton. Ammonia has three protons bonded to it. So by donating a proton, it can act as an acid. A base is any species that accepts a proton. Nitrogen in ammonia has a lone pair of electron, which can accept a proton and act as an acid. In water, ammonia accepts a proton and acts as a base.