For an inverting amplifier, Vin= 1V, R1= 5 ohms, Rf=10 ohms, frequency=100Hz. Why is output distorted
Can anyone explain how the low values of resistor are causing
  distortion in output.


In an ideal op-amp it won't distort but, in a real op-amp (such as the 741) it cannot deal with both input and feedback resistor having such low values and obvious distortion is guaranteed. The op-amp is trying to sustain the Vin- point at ground level and that means driving far too much current through the 10 ohm resistor.

Try using 5 k and 10 k resistors instead and note the difference.