If you write
( Sqrt[1 - x^2] if - 1 <= x <= 1)
the if
is interpreted as a symbolic variable with no meaning, that multiplies Sqrt[1 - x^2]
.
The if that you see when you do this
Solve[x^2 + y^2 == 1, y, Reals]
is for display only. It is not valid input syntax.