What is needed for $y=f(x)$ to be considered a function? When is an equation of the form $ y = f(x)$ not a function? Does it need to be surjective, injective, both, neither? I vaguely remember something called the vertical line test, but it's not making any connections in my brain.
Also, I'm reading a book about differential equations and there's a sentence in it that brought this question to mind. It reads, "the equation $ y = \sqrt{-(1+x^2)}$ does not define a function." What is it about that equation/corresponding graph that fails the definition of a function?
 A: 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.
