Designing a diode waveform shaping circuit resulting in specific transfer function
You're almost there... The diode network you came up with makes sense.

However, your circuit will clamp the output voltage at +0.7 and -4.7V instead of presenting a transfer function with slope=1 as requested.

Consider having the diode network in series between Vi and Vo instead. It's a good idea to have a shunt resistor on the output side to make sure Vo goes to zero between -4.7V and +0.7V.