Analyzing circuits with diodes
Answering your second question first, since I think it's the key. There are clearly two regions of operation here, diode on and diode off. You need to solve for the input voltage where you move from one region to the next, which is when the voltage across R1 is just barely enough to turn the diode on (Vd,on), whilst ignoring the diode. 

The input voltage under those conditions is Vin = VB - Vd,on - I*R2 (defining current I as flowing into the source, and thus Vd,on as positive). 

However, we know that the current I = Vd,on/R1, so we can say that the input voltage is

Vin = VB - I * (R1+R2) = VB - (Vd,on)*(R1+R2)/R1

The solutions for the two regions of operation can then be easily written down.

Edit: It does appear that the solution has a sign error, or (alternately) that Vd,on is defined to be negative (which may be technically correct, but is just confusing). 

The output voltage expression in the blue circle is correct- it's just a voltage divider when the diode is 'off', dividing down (Vin - Vb), as is the expression below that- input voltage plus the diode drop minus Vb, but the slope is 1 since there is no series resistor.