For isothermal compression of an ideal gas, the work done on the air can be computed by integration
of - P dV with P given by P = n R T /V. The result is W = n R T ln( 300 / 100) = n R T ln(3)
Here R is the gas constant ( R = 8.314) and n is the number of moles.
To put this on a per mass basis, note that for air, a mass of M grams corresponds to ~ (.75 14 + .25 16) n
This is based on air being approximately 75% N2 and 25% O2
Thus n = M/(14.5) , where M is quoted in grams.
Then W / M = R T ln(3) / 14.5 ( T = 303 K)
The internal energy of an ideal gas depends only on the temperature. Since the temperature does not change, the change in internal energy is zero.
By the First Law, the amount of heat flowing out of the air must be the same as the work done on the air. So
the amount of heat flowing out of the air is W (see above)
All of this depends on air being a nearly ideal gas which it is at 303 K and 100 - 300 kPa