Not understanding the wrong logic in this proof The problem is :
Suppose $a,b \in Z$. If $a^2 + b^2 $ is a perfect square, then $a$ and $b$ are not both odd.
My question is why can't I answer like so:
Proof by Contradiction -- Suppose $a^2 + b^2 $ is a perfect square, and $a$ and $b$ are both odd. Let $a = 5$ and $b = 7$. Then $5^2 + 7^2$ is a perfect square. $5^2 + 7^2 = 74$, so 74 is a perfect square. However, we know that 74 is not a perfect square. Therefore there is a contradiction. So if $a^2 + b^2 $ is a perfect square, then $a$ and $b$ are not both odd.
 A: The reason why this proof is invalid is that the quantifier is not included.
The preposition should be:
$\forall a,b \in Z, $ if $a^2 + b^2$ is a prefect square, then $a$ and $b$ are not both odd.
The counter-positive of this notion is:
$\forall a,b \in Z, $  if $a$ and $b$ are both odd then $a^2 + b^2$ is not a prefect square. 
So one should not pick up specific example to show the counter-positive holds.
EDIT: to clarify logical reason, consider the following example:
The background is that $R$ is an algebraic structure.
The preposition is: $\forall a,b \in R$, if $a\times b$ is $0$, then $a = 0$ or $b =0 $. 
What's the counter-positive of this statement?
It should not be: $\exists a,b \in R$, if $a \neq 0$ and $b \neq 0 $,$a\times b$ is not $0$.
Because if $R = \mathbb Z/6\mathbb Z$, then $a = 2$ and $b =2 $, then   $a\times b = 4$ is not $0$. But in $R$ there indeed pair$(2,3)$ such that  $2\times 3 = 0$ but $2$ is not zero and $3$ is not zero. Therefore it should not be an counter-positive for the preposition.
One thing  which should be borne into my mind is that when one counter the preposition, the quantifier should not change otherwise one may be trapped into logical loophole. 
A: The idea of a proof by contradiction is that you assume something and
then derive a false statement from the assumption,
which means the thing you assumed must have been false.
You start out this proof well enough,

Suppose $a^2+b^2$ is a perfect square, and $a$ and $b$ are both odd.

If you could show that this assumption alone led to a false statement,
you'd have a proof. But your next sentence is,

Let $a=5$ and $b=7$.

That's another assumption. So now you've actually assumed the following
compound statement,

Suppose $a^2+b^2$ is a perfect square, $a$ and $b$ are both odd, $a=5$, and $b=7$.

Since $a=5$ and $b=7$ imply that $a$ and $b$ are both odd,
your assumption is equivalent to this assumption:

Suppose $a^2+b^2$ is a perfect square, $a=5$, and $b=7$.

You correctly show that this statement leads to a contradiction.
So you have now proved the following theorem:

Suppose $a,b \in Z$. If $a^2 + b^2$ is a perfect square, then it is not true that $a=5$ and $b=7$.

I think it should be clear enough that this theorem says a lot less than the theorem you were originally trying to prove.
A: For the same reason the following "proof" is wrong:
Let n be an odd number. Let n = 3, which we know is prime. Therefore, all odd numbers are prime.
If you want to show that $a$ and $b$ cannot both be odd, it is not sufficient to show that they cannot be 5 and 7. They could be some other numbers! Even if you eliminate your one example from those available, it is still possible that another one will work. You have to eliminate all possible pairs of odd numbers in order to show a true contradiction. The error comes in when you "let" $a$ and $b$ be 5 and 7. When showing a contradiction, you have to deal with the most general case, ANY pair of odd numbers. If you wanted to show instead that $a$ and $b$ could possibly be even, then the single example $a=6, b=8$ would suffice.
In general, if you want to show that a FOR ALL statement is true, you need to work in the general case. If you want to show that a THERE EXISTS statement is true, you need an example (specific case). If you want to show that a FOR ALL statement is false, you need a counterexample (specific case). And if you want to show that a THERE EXISTS statement is false, you need to work in the general case. In short, $\forall x (p) = \exists $
A: hint: consider $\mod 4$ . A square can only be $0,1 \mod 4$. Note that this is a proof that for the sum of two squares to be a square again, both can't be odd. For your proof, you are incomplete hence wrong because your argument is true only for the case $a = 5, b = 7$ but you don't cover all cases for $a,b$. 
