I am asked to prove the following: $$\dfrac{1-\cos x}{\sin x}=\dfrac{\sin x}{1+\cos x}=\tan\dfrac x2.$$
Looking at the answer

I am not able to see what is going on here:
$$\frac{1 - \cos(x)}{\sin(x)}=\frac{1 - \cos{(2\cdot\frac{x}{2})}}{\sin{(2\cdot\frac{x}{2})}}.$$
You seem to have mistaken $\cos(2x)$ with $\cos^2 x$. In the step you seem to be referring to, they write
$$x = 2 \cdot \frac x 2$$
and then take cosine / sine across the equality to get
$$\cos x = \cos \left(2 \frac x 2 \right) \quad\quad \sin x = \sin \left(2 \frac x 2 \right)$$
They then proceed with double-angle identities.