Q:

Prove if $x,y$ integers then there are $p,q$ integers such that $xy = p^2 - q^2$.

Prove that if $x$ and $y$ are any two integers which are both even or both odd then there are integers $p$ and $q$ such that $xy = p^2 - q^2$.
Prove that if n is an integer which is $2 \mod 4$ then $n$ cannot be written in the form $p^2 - q^2$ for integers $p$ and $q$.

I'm really stuck what to do on the first one. I know its possible as $xy$ will be even and $p^2 - q^2$ will be even, but I don't know how to show it will equal. Can someone give me a hint?
For the second one, I have said this:
1) If $p,q$ are odd then we get $p,q \equiv 1 \mod 4 \implies p^2, q^2 \equiv 1 \mod 4$. So we then get $p^2 - q^2 \equiv 1 - 1 \mod 4 \equiv 0 \mod 4$.
2) If $p,q$ are even then we get $p,q \equiv 0 \mod 4 \implies p^2, q^2 \equiv 0 \mod 4$ and so $p^2 - q^2 \equiv 0 - 0 = 0 \mod 4$.
3) Finally, if one of $p,q$ is odd and the other even, then wlg, $p \equiv 1 \mod 4 \implies p^2 \equiv 0 \mod 4$ and $q \equiv 0 \mod 4 \implies q^2 \equiv 0 \mod 4$ and so we get $p^2 - q^2 \equiv 1 - 0 = 1 \mod 4$.
Which shows that with all combinations of $p,q$ even or odd, it isn't possible to get $2 \mod 4$. Is this correct?

A:

For the first question, note that if $x$ and $y$ are even or odd, $$\left(\frac{x+y}{2}\right)^2 - \left(\frac{x-y}{2}\right)^2 = xy,$$ and both of $\dfrac{x+y}{2}$ and $\dfrac{x-y}{2}$ are integers.
Your argument for the second question looks mostly good: you can't claim that $p,q$ are $0$ or $1$ mod $4$, but this does always hold for their squares, so it winds up working.

A:

For the first part, consider the difference of two squares: $$xy=(p-q)(p+q)$$
So let, say, $p-q=x$ and $p+q=y$. Thus $2p=x+y \implies p=\frac{x+y}{2} \implies q=\frac{y-x}{2}$
$p,q$ must be integers since, by the condition, $x+y$ and $y-x$ are even.

