Say $n\in \mathbb N$ with n odd and $n|y^2-1$ for some $y \in\mathbb N$. Show that $n=gcd(n,y-1)gcd(n,y+1)$. Also show a counterexample when $n$ is even. 

I know that $n|y^2-1=(y+1)(y-1)$ so $n|(y+1)$ and $n|(y-1)$. 

Since $n|(y+1)$ we can say $y+1=nx$ for some $x\in \mathbb Z$.

Similarly $n|(y-1)$ we can say $y-1=ny$ for some $y\in \mathbb Z$.

So $y^2-1=(y+1)(y-1)=n^2xy$.

I am having issues connecting this back to what we are trying to show.