When negating a "complex" mathematical statement, which part of the statement should be negated? This is a general question, so I will provide an easy example, which everyone can reference for clarity. However, I am really looking for a general rule.
Consider the following implication that I am pulling from Daniel Solow's book How to Read and Do Proofs:
If $r$ is a real number such that $r^2 =2$, then $r$ is not rational.
Dr. Solow asks the reader to write the inverse of this implication.
I wrote it as follows:
If $r$ is not a real number that satisfies $r^2=2$, then $r$ is rational.
However, in the solutions manual, the answer is:
If $r$ is a real number such that $r^2 \neq 2$, then $r$ is rational.
In thinking about this a little bit, I am fairly certain these are not equivalent statements (though perhaps they are). In my version, I basically negated the "set from which we are drawing our number $r$ from"...i.e. I've made it so that it can be any number besides a real number. In Solow's correct answer, he negated the "property that the number exhibits"...i.e. being equal to $2$. 
There are many other instances where I observe this sort of discrepancy of "what to negate within a complex sentence". Is there a general rule of thumb that someone could share with me so that I do not make this mistake again?
 A: There is no hard and fast rule, because even mathematical statements are typically not written formally enough — English is a complicated language, and sentences written in it are very difficult to analyze. The key is to understand what the point of a negation is:
 The negation of a proposition P is a statement which is true exactly when P is not.

It may help to consider individual cases; it's hard to conceptualize generalities, but specific numbers are easier. For example, when negating the sentence "$r$ is a real number such that $r^2 = 2$", consider that the sentence is true when $r = \sqrt{2}$ and false when $r = 3$. So your negation should be false when $r = \sqrt{2}$ and true when $r = 3$.
Curiously, in the particular example you're giving, your answer is the correct one, if the question is exactly as written. Dr. Solow's answer only makes sense if it is assumed that the domain of discourse is real numbers (i.e., things which are not real numbers don't exist). The easy way to tell this is that "$r$ is a real number such that $r^2 = 2$" is false when $r$ is a puppy, because puppies aren't numbers (real or otherwise). So the negation should be true when $r$ is a puppy. But "$r$ is a real number such that $r^2 \neq 2$" is false when $r$ is a puppy — puppies still aren't numbers.
It is fairly typical to assume a domain of discourse like that; if I say "for all $x$, $x + 1 > x$", it's clear that I mean to be talking only about values of $x$ to which the operations $+$ and $>$ can reasonably be applied. But if we're being absolutely precise about our language, then it is absolutely not correct to say that "$r$ is a real number such that $r^2\neq 2$" is the negation of "$r$ is a real number such that $r^2 = 2$".
A: I agree with Reese that natural language is a weak model for logic, so let's translate the sentence into the propositional calculus.  If we take $R=(r\in\mathbb R)$, $S=(r^2=2)$, and $Q=(r\in\mathbb Q)$, then the original statement is
$$R\to(S\to \neg Q)$$
("such that" can also be read as $(R \wedge S)\to\neg Q$, but those are logically equivalent, so we're fine.)   Since an implication is false if and only if it's antecedent is true and its consequent is false, we can simplify the negation of this statement as follows:
$$\neg (R\to(S\to\neg Q))$$
$$R\wedge\neg (S\to\neg Q)$$
$$R\wedge S\wedge Q$$
So given that, the negation of the statement is "$r$ is a real number such that $r^2=2$ and $r$ is rational."
