Suppose by contrary that one of a,b is even, say a. So a2+1 is odd. This means that b+1 must be odd, or equivalently, b is even. We will prove that this cannot happen.
Indeed, put d=gcd(a+1,b+1) then d∣a+1∣b2+1, hence d∣b2−b=b(b+1)+2b. From this, we have d∣2b and d∣2(b+1)=2b+2 so d∣2. But a+1,b+1 are odd numbers so d odd, which gives d=1.
On the other hand, by assumption a+1∣a2+b2, b+1∣a2+b2, we get a2+b2=(a2+1)+(b2−1)=(a2−1)+(b2+1) is divisible by both a+1 and b+1. Therefore (a+1)(b+1)∣a2+b2 (since a+1 and b+1 are coprime).
In other words, there exists a positive integer k such that
a2+b2=k(a+1)(b+1).
We now prove that this equation has no integer solution. Fix a value of n, assume that this equation has a solution of positive integers. We can choose positive integers x0,y0 satisfying the equation with the property that the sum x0+y0 is smallest and x0≥y0.
Consider the quadratic equation
X2−X⋅n(y0+1)+y02−ny0−n=0.(∗)
This equation has a solution x0 so it also has another solution, say x1. From Vieta's theorem, we have
x0+x1=n(y0+1),x0x1=y02−ny0−n
We consider the following cases:
1. If x1<0, i.e. x1≤−1, then from (∗) we see that x12−x1⋅n(y0+1)+y02−ny0−n=0 or
0≥x12+n(y0+1)+y02−ny0−n=x12+y02>0,
which is clearly a contradiction.
2. If x1>0 then (x1,y0) is also another solution of (∗), from the choice of x0, we have x1>x0. Moreover, since x0x1=y02−ny0−n it follows that x02<x0x1=y02−ny0−n<y02, this is also a contradiction because of the inequality x0≥y0.
Hence, x1=0, and in this case y02=n(y0+1), which implies that y0+1∣y02. This cannot hold for y0≥2.
Therefore, we conclude that a,b are odd numbers, this ends the proof.