The work done by a gas is the area under its path on the P-V diagram: positive when the volume increases, negative when it decreases.
D to E (expansion along a straight line): the area under DE is a trapezium of width 5.0−2.0=3.0 m3 with parallel sides 600 and 300 N m−2:
WDE=21(600+300)×3.0=+1350 J
E to F (isobaric compression at 300 N m−2): the volume falls by 3.0 m3, so
WEF=P(VF−VE)=300×(2.0−5.0)=−900 J
Total work done by the gas:
W=WDE+WEF=1350−900=450 J

This is just the area of the shaded triangle DEF, with base EF=ΔV=3.0 m3 and height DF=ΔP=600−300=300 N m−2:
W=21×3.0×300=450 J
The total work done by the gas from D to E to F is 450 J (positive, because more work is done by the gas during the expansion than is done on it during the compression).