An ideal gas is squeezed slowly from state A (pressure-600 kPa, volume- 1 L) to B ( pressure-400kPa, volume- 0.5 L).

What is the work done or received by the gas?

The relationship between pressure and volume depends upon whether the process is adiabatic, isothermal, or something else. In your case, there a lot of heat removal going on because the pressure drops while the volume decreases. Work is received doing the compression. You have a "something else" process.

A better description of the process is needed. For an estimate of the work received, multiply the average pressure (500*10^3 N/m^2) by the volume change (0.5*10^-3 m^3) . That would be 250 Joules