First: To prove $\;p\implies q$ using a proof by contradiction, it is not a good idea to think of it as "assuming the opposite." Assuming the opposite of what? In logic as in math, it's good to think of "opposite" of an assertion as its negation. And importantly, you need to remember here exactly which part of the overall assertion gets "negated" in our assumption:
We have an overall assertion which we call an implication, which has the form $\;p \implies q$: $\;p$ happens to also be an assertion (serving as a premise, or antecedent, of the implication) which is said to imply another assertion, $q$ (which we call the conclusion, or consequent, of the implication.)
Now: To prove $p \implies q$ using a proof by contradiction, you assume the premise $p$, and you also assume the negation of $q$, that is, you assume the negation of the conclusion.
In this case, you start by assuming that the premise $x^2 + 2x - 3 = 0$ is true, and by assuming that it is not the case that the conclusion "$x \neq 2$" holds(i.e., you assume it is false that $x \neq 2)$. In other words, here, we assume $x^2 + 2x - 3 = 0\;$ and suppose $\bf x = 2$. Now the aim is to arrive at a contradiction.
.....[Work needed: find the contradiction].....
Then, having found a contradiction, you can conclude that the assumption $(x = 2)$ is false, and therefore, it follows that if the premise $x^2 + 2x - 3$ is true, then the conclusion $\lnot (x = 2) \iff \;x \neq 2$ must also be true.