<s>[INST] How find positive integers $a,b$ such $a \mid b^2$, $b \mid a^2$, $(a+1) \mid (b^2+1)$. Find all postive integer $a,b$ such that
$$a \mid b^2, \quad b \mid a^2$$
and 
$$(a+1) \mid (b^2+1)$$
It is clear that $a=b=1$ is a solution. It is also true that
$$(a,b)=(n^2,n^3),n\in N^{+}$$
is a solution. What other solutions exist?
 [/INST] Let $b^2=ca$. By the given data $ca\mid a^4$ and $(a+1)\mid (ca+1)$ which is equivalent to $c\mid a^3$, $(a+1)\mid (c-1)$. Let $c=d(a+1)+1$, $d\in \mathbb{N}_0$. Now since $a^3\equiv-1\pmod{a+1}$, we have that $\frac{a^3}{c}\equiv-1\pmod{a+1}$ or $\frac{a^3}{c}=e(a+1)-1$ for $e\in\mathbb{N}$.
It follows that $a^3=(d(a+1)+1)(e(a+1)-1)$, which after multiplying and dividing by $a+1$ than we get $a^2-a+1=de(a+1)+(e-d)$ than it's $e-d\equiv a^2-a+1\equiv 3\pmod{a+1}$, so we have $e-d=k(a+1)+3$, $$de=a-2-k\tag{*}$$ for $k\in\mathbb{Z}$
Now we have 3 cases.
Case 1. $k\not\in\{-1,0\}$. From $(*)$, we have $de<\lvert e-d \rvert -1$, which is possible for $d=0$,so $c=1$ and $b^2=a$. Hence $(a,b)=(t^2,t)$
Case 2. $k=-1$. From $(*)$, we have that $a=d+1$. Now $c=a^2$ and $b^2=a^3$, and hence $(a,b)=(t^2,t^3)$.
Case 3. $k=0$. From $(*)$, we get $a=d^2+3d+2$. Now we have $c=d(a+1)+1=(d+1)^3$ and $b^2=ca=(d+1)^4(d+2)$. It follows that $d+2=t^2$ for $t\in\mathbb{N}$, which gives $(a,b)=(t^2(t^2-1),t(t^2-1)^2),t\geq 2$.
</s>