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 Vn between ground and the inverting terminal Vn=0 (in reality it is as 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
EDIT: Finite Aol.
For finite Aol we have Vn=Vn1+Vn2=-Vout/Aol
This expression leads to Vout/Vin=-Rf/[Ri+(Ri+Rf)/Aol]
For Aol infinite this expression reduces again to Vout/Vi=-Rf/Ri