cot-1(x) in terms of sin-1

problem is cot-1(x) in terms of sin-1

My attempt at the solution.

drawing a right triangle where cosy = x, sin y = 1 and (x^2+1)^1/2= hypothenuse.

trig identity 1+ cot^2(y)=1/sin^2(y)

then just a cross multiply and change terms for coty which is x and get

siny= 1/(1+x^2)^1/2. inversing it into

sin-1(1/(1+x^2)^1/2))=y

Solution says cot−1 x = sin−1 (sgn x /(1+x^2)^1/2).

earlier they also state that

If y = cot−1 x, then x = cot y and 0 < y < pi/2.

What i dont get is the sgn x part. I know its |X|/x but i dont understand how i am supposed to get it in to my solution.

Thankful for any help.