Circuit Analysis with an ideal diode
Let's call the node the anode of the diode is connected to "node A" and the node the cathode is connected to "node C" and the voltages of those nodes \$v_A\$ and \$v_C\$ respectively.

Now look at the circuit without the diode and find out what V1 needs to be for


case1: \$v_A &gt; v_C\$
case2: \$v_A &lt; v_C\$


Now do circuit analysis for each of the two cases where in


case1: diode is replaced by a short between node A and node C
case2: diode is removed (no connection between node A and node C)  


Case1 is the part where the red graph is flat.
Case2 is the part where the red graph is curved.