Is this proof correct:
An odd integer $n \in \mathbb{N}$ is composite iff it can be written in the form
$n = x^2 - y^2, y+1 < x$
Proof:
$\leftarrow$
Want: $n = ab$ Where $a$ and $b$ are odd integers (since $n$ is odd)
Let $n = x^2 - y^2, x > y + 1$. Let $x = \dfrac{a+b}{2}$ and let $y= \dfrac{a-b}{2}$ where $a$ and $b$ are odd integers.
Consider $n = x^2 - y^2$:
$ = (x+y)(x-y) \iff (\dfrac{a+b}{2} + \dfrac{a-b}{2})\cdot(\dfrac{a+b}{2} - \dfrac{a-b}{2})$
Thus we have $ab$.
Now I could do similar steps backwards to prove the other direction.
The part when you say "Let $x=\frac{a+b}2$ and let $y$..." is not really clear. In the $\Leftarrow$ direction $x$ and $y$ should be considered as given, and define $a$ and $b$ using them, and show that they are integers.