The "flag" houses a holographic scanner and a range-finding sensor which interface with a HUD inside the helmet. The entire whole unit is typically referred to as a 'rangefinder'
Targeting rangefinder (retracted) The helmet tracking sensors sent information directly to the helmet displays. It gave Fett precise readings on the speed of, and distance to any given target.
and
Holographic targeting display
When flipped down, the targeting display interfaces with the visor to give tracking information on up to 30 targets at a time.
And, as you can see from these image from The Empire Strikes Back, The Clone Wars, the flag folds down so that it makes an eyepiece, as can be seen in Attack of the Clones when Jango fires his bolo at Obi-Wan.