How to get half frequency square wave from sin wave?
The frequency of your square wave is the same as your sine, it's not half.  

The following solution focuses on getting the 45° phase difference between sine and pulse.
Differentiate the sine to get a cosine. (Note that a simple RC differentiator won't give you the required 90° phase shift. The opamp differentiator will.)
Pass both sine and cosine though a comparator, where you compare with 0V. This will get you two 50% square waves 90° phase shifted. AND these and you're there.  



This will get you the 45° phase shift between sine and pulse as shown. If phase is not important then Russell's idea of the flip-flop is also good. AND flip-flop input and output to get a 25% duty cycle.