1) Note that the bottom waveform is 1/2 the frequency of the input.
2) Apply the input waveform to a comparator
3) The output of the comparator drives the clock input of a flip-flop.
4) Did I just do your homework for you?
This solution would not create EXACTLY the output shown. IF you really need output to switch at the inflection point of the input (where the slope changes from negative to positive), you would need to use something fancier, like a differentiator.