In these problems break the analysis into two cases -- when the diode is conducting and when it is not. When it is not conducting you can remove it from the circuit. When it is conducting you can assume the following:
- it's voltage drop is 0.7V
- the current must be flowing from anode to cathode

simulate this circuit – Schematic created using CircuitLab
Case 1: The diode is not conducting.
We just have resistors and voltage sources and so \$V_{out} = (V_{in}-V_b)\frac{R_2}{R_1+R_2}\$.
Case 2: The diode is conducting.
Then \$V_x = V_{in}+0.7\$ and \$V_{out} = V_x - V_b\$, so \$V_{out} = V_{in} + 0.7 - V_b\$.
Now we have to determine for what values of \$V_{in}\$ the diode is conducting and when it isn't.
For the diode to be conducting we must have:
- the current I has to be negative (flowing counter-clockwise)
- the voltage drop across R1 is 0.7V
Note that the current \$I\$ is the current flowing through R1 plus the current flowing through the diode.
Translating these conditions into math gives us the condition: \$I < -0.7/ R_1\$.
Now use these three statements:
$$
\begin{align}
I &< -0.7/R_1 \\
V_{out} &= IR_2 \\
V_{out} &= V_{in} + 0.7 - V_b \\
\end{align}
$$
and you can come up with a condition on \$V_{in}\$ which tells you when the diode is conducting.