Answer
(a) -261 J
(b) Work is done on the system
Work Step by Step
(a) Here we use the first law of thermodynamics $Q=\Delta U+W$ to find the solution.
* For the return process :
$Q_{r}=\Delta U_{r}+W_{r}=> W_{r}=Q_{r}-\Delta U_{r}$
Let's plug known values into this equation.
$ W_{r}=-114\space J-\Delta U_{r}-(1)$
* For the outgoing process :
$Q_{o}=\Delta U_{o}+W_{o}=> \Delta U_{o}=Q_{o}-W_{o}$
Let's plug known values into this equation.
$ \Delta U_{o}=165\space J-312\space J=-147\space J$
Let's use the fact that the return process brings the system back to its initial state and express the overall change in the internal energy due to the outgoing and the return process as follows.
$\Delta U_{total}=\Delta U_{o}+\Delta U_{r}=0=>\Delta U_{r}=-\Delta U_{o}$
$\Delta U_{r}=-(-147)\space J=147\space J$
(1)=>
$ W_{r}=-114\space J-147\space J=-261\space J$
(b) The value of $ W_{r}$ is negative. So, work is done on the system.