since the gas and water are at the same temperature, no heat can flow between them, which makes this an adiabatic compression. since the temperature of the gas remains constant, the pressure of the gas must also remain constant. the internal energy of the gas decreases during the compression because the volume decreases. the internal energy of the gas increases during the compression because work is done on the gas. heat leaves the gas during the compression.