[Check my homework]Electronics homework - op amp and transistor
When you work with diode, transistors and basically anything that has different models depending on different operating points, you always have to verify that your starting assumptions are compatible with the solution you have got. If this is not the case, your starting assumptions were wrong.

Let's start with your first case. It looks very promising, but have you thought about the direction of the current in the diode? When it is forward biased, current can go only in one direction. Is this the case for any \$v_G\$?

In your second case you do not calculate \$v_I(v_G)\$, because \$v_{EB}\$ does not equal \$v_I\$.

Some help follows:

SPOILER 1:


   If \$v_G\$=0 both the transistor and the diode are off, if it is positive only the transistor is on, if it is negative only the diode is on.


SPOILER 2:


   The opamp output makes a steps when \$v_G\$ changes sign.


If you really can't make it, try to simulate the following circuit:






simulate this circuit &ndash; Schematic created using CircuitLab