How to set threshold above or below which the signal turns zero
Begin with a window comparator: -



The one above works with a positive supply rail but is easily reconfigured for a split rail supply that allows the full negative and positive input range desired.

So, you have a positive logic output signal from the window comparator that tells you your input signal is not too positive and not too negative. If the input rises too high or too low, the logic output drops to 0 volts (or minus voltage for a split rail supply) indicating your signal should be clamped to 0 volts.

Use the above logic output and an analogue switch to disconnect your input signal from your "real" output when the input is "out of range". You will probably choose to convert the logic signal from the window comparator to something more suitable for the enable pin on the analogue switch such as 5 volt logic levels: -