Applying the superposition principle, is the most simple method for finding the closed-loop gain of the inverter circuit. As long as the opamp is operated within its linear region we can set the resulting voltage between ground and the inveerting terminal Vn=0 (in reality iit is sas small as some µVolts)
Superposition:
(1) Vout=0: Vn1=Vi*Rf/(Ri+Rf)
(2) Vi=0: Vn2=Vout*Ri/(Rf+Ri)
(3) Setting Vn=Vn1+Vn2=0 we arrive at Vout/Vi=-Rf/Ri