Calculation of a feedback resistor in an inverting shmitt trigger
To answer your second question first, if  you have a signal with noise on top, and that signal has a relatively slow slew rate through the point where the comparator switches, you can get many transitions where you would prefer only one. Image below from here 



By adding some hysteresis, more than the noise peak-to-peak voltage, you can get just one transition per cycle of the underlying signal and the noise will be ignored. 



With the circuit you show, if you consider the Thevenin equivalent of the part of the circuit to the left of the comparator, you have a 2.5V source and 5K resistor, and there's a voltage divider with the series resistance Rfeedback to the output. If the output changes by 5V (it may not!) then the hysteresis is just: 

Vhyst = \$ 5\text{V} (\frac{5\text{k}\Omega}{5\text{k}\Omega + R_{feedback}})\$

The hysteresis will be centered above the 2.5V level by half the hysteresis since the output is assumed here to go from 0V to 5V. That means that if you change Rfeedback, the center of the hysteresis band shifts so you can't independently adjust the hysteresis by changing one part value without affecting the center of the band.