We present temperature dependent inelastic neutron scattering measurments, accompanied byab-initio calculations of phonon spectra and elastic properties as a function of pressure to understand anharmonicity of phonons and to study the mechanism of negative thermal expansion and negative linear compressibility behaviour of ZnAu2(CN)4. The mechanism is identified in terms of specific anharmonic modes that involve bending of the Zn(CN)4-Au- Zn(CN)4 linkage. The high-pressure phase transition at about 2 GPa is also investigated and found to be related to softening of a phonon mode at the L-point at the Brillouin zone boundary and its coupling with a zone-centre phonon and an M-point phonon in the ambient pressure phase. Although the phase transition is primarily driven by a L-point soft phonon mode, which usually leads to a second order transition with a 2 x 2 x 2 supercell, in the present case the structure is close to an elastic instability that leads to a weakly first order transition.