Why is -Vout equal to the voltage going through Rf?
(1) The voltage at the inverting terminal is 0V* so, by KVL,
$$v_{OUT} = 0V - i_{R_F}R_F $$
where the reference direction for \$i_{R_F}\$ is from left to right through \$R_F\$
(2) By KCL,
$$i_{R_i} = i_{R_F} $$
since the inverting input is an open circuit.
(3) By Ohm's Law,
$$i_{R_i} = \dfrac{v_{IN}}{R_i}$$
(remember, the voltage at the inverting terminal is 0V).
Thus:
$$v_{OUT} = 0V - i_{R_F}R_F = -i_{R_i}R_F = -\dfrac{v_{IN}}{R_i}R_F$$
or
$$\dfrac{v_{OUT}}{v_{IN}} = -\dfrac{R_F}{R_i}$$
*For an ideal op-amp with negative feedback, the inverting and non-inverting input voltages are equal.
Best Answer
Oh, geez. I see a diode/BJT solution and a MOSFET solution.
No one did the obvious BJT-only solutions.
So I might as well add those too, now:
simulate this circuit – Schematic created using CircuitLab
Here, I'm starting with a PNP follower and cascading it with an NPN follower (on the left.) Or, cascading an NPN follower by a PNP follower (on the right.) Either way, if you set things up so that \$R_1\approx R_2\$ then the collector currents will be similar and the \$V_{BE}\$ values therefore also similar. (It can be adjusted easily, of course, to tweak it in better.)
It's an okay way to cancel the \$V_{BE}\$ offset. And does the work of your opamp without the use of an opamp (which would be better to use because the opamp would have gigaohms of input impedance and active sink and source at the output.)
Put a resistor divider at the input, if you want.
How did this idea get missed? I don't know.