The identity has been wrongly stated. It should be:
(cosecθ-cotθ)2=(1-cosθ)/(1+cosθ).
Take the right-hand side expression and multiply top and bottom by 1-cosθ:
(1-cosθ)2/(1-cos2θ)=(1-2cosθ+cos2θ)/sin2θ=
cosec2θ-2cotθcosecθ+cot2θ=(cosecθ-cotθ)2, which is the left-hand side.
This proves (cosecθ-cotθ)2=(1-cosθ)/(1+cosθ) QED