Proving that if $a+b$ and $ab$ are of the same parity, then $a$ and $b$ are even. Here is the proof:

Let $a,b \in \mathbb{Z}$. Prove that if $a+b$ and $ab$ are of the same parity, then $a$ and $b$ are even.

When working these problems, I do try to set them up logically. My scratch work usually looks something like this:

$P: a+b$ and $ab$ are the same parity
$Q: a$ and $b$ are even
$P \Rightarrow Q:$ If $a+b$ and $ab$ are the same parity, then $a$ and $b$ are even.
$Q \Rightarrow P$: If $a$ and $b$ are even, then $a+b$ are the same parity.

For some reason, I am getting caught up on writing the contrapositive of this statement when addressing the forwards ($P \Rightarrow Q$) direction of this biconditional.
Here is what I was thinking:

If $a$ or $b$ is not even (odd), then $a+b$ or $ab$ are of different parity.

I believe I am negating too much, and this is where I struggle: what would the proper negation look like? How do I know what to negate (or switch) vs. what I should leave alone? I generally get that &quot;and&quot; becomes an &quot;or&quot;, but then I feel like I start to negate too much (if that makes sense...).
Any advice? I can usually get this far pretty easily, but I wanted to use contrapositive for $P \Rightarrow Q$, and I don't believe I am writing the statement correctly. In addition to verifying this, I would appreciate any advice when it comes to what portion of my statement I should negate. Thanks!
The contrapositive of the statement


  If $\overbrace{\text{$ab$ and $a+b$ have the same parity}}^{\large P}$, then $\overbrace{\text{$a$ is even and $b$ is even}}^{\large Q}$.


is


  If $\overbrace{\text{$a$ is odd or $b$ is odd}}^{\large\lnot Q}$, then $\overbrace{\text{$ab$ and $a+b$ have different parities}}^{\large\lnot P}$.


Note that $Q$ is the conjunction $S\land T$, where $S$ means "$a$ is even" and $T$ means "$b$ is even". Thus, $\lnot Q$ is the disjunction $\lnot S\lor\lnot T$.



Here is an alternate approach:

$\begin{array}{cr}
\text{$ab$ and $a+b$ have the same parity}\\
\Updownarrow&amp;\qquad\text{(1)}\\
\text{$ab-(a+b)$ is even}\\
\Updownarrow&amp;\qquad\text{(2)}\\
\text{$(a-1)(b-1)$ is odd}\\
\Updownarrow&amp;\qquad\text{(3)}\\
\text{$a-1$ is odd and $b-1$ is odd}\\
\Updownarrow&amp;\qquad\text{(4)}\\
\text{$a$ is even and $b$ is even}\\
\end{array}$

Comments:
$(1)$: $m$ and $n$ have the same parity if and only if $m-n$ is even
$(2)$: $ab-(a+b)=(a-1)(b-1)-1$
$(3)$: $mn$ is odd if and only if both $m$ and $n$ are odd
$(4)$: $a-1$ has the opposite parity from $a$
Consider the parity tables.

Addition $+$
$$
\begin{array}{cc|cc|cc}
+ &amp;   &amp; a &amp; a &amp; b &amp; b\\
  &amp;   &amp; o &amp; \bbox[4px,border:2px solid #008000]e &amp; o &amp; \bbox[4px,border:2px solid #008000]e\\
\hline
a &amp; o &amp; e &amp; o &amp; e &amp; o\\
a &amp; \bbox[4px,border:2px solid #008000]e &amp; o &amp; \bbox[4px,border:2px solid #800000]e &amp; o &amp; \bbox[4px,border:2px solid #800000]e\\
\hline
b &amp; o &amp; e &amp; o &amp; e &amp; o\\
b &amp; \bbox[4px,border:2px solid #008000]e &amp; o &amp; \bbox[4px,border:2px solid #800000]e &amp; o &amp; \bbox[4px,border:2px solid #800000]e
\end{array}
$$

Multiplication $\cdot$
$$
\begin{array}{cc|cc|cc}
\cdot &amp;   &amp; a &amp; a &amp; b &amp; b\\
      &amp;   &amp; o &amp; \bbox[4px,border:2px solid #008000]e &amp; o &amp; \bbox[4px,border:2px solid #008000]e\\
\hline
a     &amp; o &amp; o &amp; e &amp; o &amp; e\\
a     &amp; \bbox[4px,border:2px solid #008000]e &amp; e &amp; \bbox[4px,border:2px solid #800000]e &amp; e &amp; \bbox[4px,border:2px solid #800000]e\\
\hline
b     &amp; o &amp; o &amp; e &amp; o &amp; e\\
b     &amp; \bbox[4px,border:2px solid #008000]e &amp; e &amp; \bbox[4px,border:2px solid #800000]e &amp; e &amp; \bbox[4px,border:2px solid #800000]e
\end{array}
$$

Clearly both $a$ and $b$ are even.