It is a chamber flag (I do not know the official name). Some ranges and classes will require you to show your chamber is clear with the bolt open and a flag in place where a round would lay. It is a visual safety check.
An outdoor range will require that in your firearm to ensure its empty when they call a cease fire for target change.
This ensures that all firearms are not loaded when people are down range.