Thats right. As you say $-1,1$ both map on $1$ under the function of $x^2$. This means that $f$ cant be injective. The definition you had in class pretty much does the same. If you have two values like $x=-1$ and $y=1$ with property of $f(x) = f(y) = 1$ them $f$ cant be injective because two different values are mapping onto the same value.
If you take general unknown $x$ and $y$ and say that theyre having the property of $f(x) = f(y)$ then it has to follow that $x = y$. This means that the general unknown $x,y$ you have picked are actually the same. So you did not find any two values with the same value under $f$. This means that $f$ is injective.
The other definition is just the other way around. Like $A \Rightarrow B$ is equal to $\neg B \Rightarrow \neg A$.
It does not matter which way you are going. Both will work. After time you will get a feeling which one works the best to prove.
Let me take an example. Lets show that $f(x) = x^3$ is injective.
We take general $x,y \in \mathbb{R}$. For them we say that $f(x) = f(y)$. Then we know what $f$ does to them and we will get $x^3 = y^3$. Applying the third-root will give us $x=y$. That means that $f(x) = x^3$ is injective.
The same argument wont work with $f(x)=x^2$. You have to careful applying the square root ok both sides. What you did is $\sqrt{y} = x$ but that not enough. You also get $\sqrt{y} = - x$. For example $\sqrt{y = 1} = \pm 1$ which makes perfectly sense because both $x = -1$ and $x = 1$ are mapping onto $y = 1$. This is where you might messed up something.