It is a tail stand, also called as pogo stick and is used in the aircraft during loading/unloading. It is basically a stick, which is carried around in the aircraft and attached to the rear fuselage using a pin during loading/unloading operations, as can be seen in the image below.

Air Dolomiti ATR 72-212A (I-ADLS) - Removeable tail stand installed at the rear of the aircraft when it is parked on the ground. In case of weight imbalance, this prevents the aircraft from resting on its tail. By User:Mattes - Own work, Public Domain, Link
It is found in other aircraft like Saab-Scania SF340B etc.
You're right that it must be removed before takeoff to prevent potential structural damage. However, there have been instances where aircraft have taken off with them. There have been other issues too:
First of all, there have been previous incidents where the ground crew have just tossed the tail stand into the aft compartment and not replaced it into the storage bracket. As a result, the tail stand has gotten jammed into the control cables for the tail surfaces which run through that compartment. ... . The second reason is that being less visible, the built in tail stand would occasionally be left connected to the aircraft on departure creating the potential for structural damage.
Because of this, external metal stools are used in some cases. Of course, the aircraft can be loaded/unloaded without the tail stand by loading the aircraft in appropriate sequence.