amphiprotic

capable of acting either as an acid or a base, i.e., as a proton donor or acceptor, according to the nature of the environment.