Yes, it is a function. I'm not sure you mean `y=-x^2` or `y=(-x)^2,` but both of them are functions. Now I'll explain why.
Let's speak about number single-valued functions only. A function is a rule which takes a number called argument and gives a unique result (also a number). This rule must work for all or some numbers.
In our case, for every number the rule is to multiply it by itself and then by -1. This rule gives definite and unique result for any number, so this is a function defined on a whole number line.
The different question whether this function gives different results for different numbers. If yes, such a function has an inverse function. The answer for this question is no, because for x and -x these functions give the same results.