For a function $y=f(x)$ to be called a 'function' it has to meet a certain criteria,
(i) There should be a value of $y$ for every value of $x$
(ii) There should be only one value of $y$ for every value of $x$(This is why we do vertical line test)
(iii) For every value of $x$, $y$ should be defined.
Vertical line test:- If any vertical line cuts the graph of the given function at more than one point, then it's not a function. It means for a single value of $x$, if you see the graph giving more than one value of $y$ then it's not a function (as stated above)
1. Let's take $y=x(x-1)(x-2)$

Notice that any vertical line does not cut the curve at more than one point, also notice that for every value of $x$ in its domain($x\in R$), $y$ is defined(the curve is continuous everywhere in its domain).
So $y=x(x-1)(x+1)$ is a 'function'
2. Now let's say $y^2=1-x^2$

Notice that any vertical line cuts the curve at more than one point, that means for a single value of $x$, we get more than one value of $y$.
So $y^2=1-x^2$ is not a 'function'
Now your question about $y=\sqrt{-(1+x^2)}$
$1+x^2$ is always $\ge 1$ for any value of $x$
So, $-(1+x^2)$ is always $\le -1$ for any value of $x$
That means the thing inside the square root always remains negative for any value of $x$. So, there is no real value of $y$ for any value of $x$. That's why it's not a function.
I hope its clear now.