What is the purpose of a resistor in the feedback path of a unity gain buffer?
You will rarely see a circuit with just one resistor as you show it; usually there will be another resistor (or equivalent source resistance) of the same value on the noninverting input, too.

Most (nonideal) opamps have a finite input resistance, and this means that a tiny current flows into or out of the input terminals. This current is called "input bias current", and it varies with the voltage at the inputs. Since most opamp circuits use negative feedback to keep the two inputs at the same voltage, this means that for any given voltage, the current through both inputs will be the same.

The current through each input flows through whatever resistance is connected to that input, and this introduces a voltage shift at the input. If the resistance at the two inputs is different, this voltage shift will be different, too, and the difference between those two shifts will appear as an additional input offset error in the operation of the circuit.

For this reason, an effort is made in all opamp circuits to make sure that the resistances connected to the two inputs are the same, eliminating this additional source of error. Even in a unity-gain buffer, if the source resistance is 100&Omega;, a 100-&Omega; resistor will be used in the feedback path.