Function f(n)=1, for all n∈N, is the only function satisfying the conditions of the problem.
Note that
f(1)f(2n−1)=f(n2)andf(3)f(2n−1)=f((n+1)2)
for n≥3. Thus
f(1)f(3)=f(n2)f((n+1)2).
Setting f(1)f(3)=k yields f(n2)=kn−3f(9) for n≥3. Similarly, for all h≥1,
f(h)f(h+2)=f(m2)f((m+1)2)
for sufficiently large m and is thus also k. Hence f(2h)=kh−1f(2) and f(2h+1)=khf(1).
But
f(9)f(25)=f(23)f(25)⋯f(9)f(11)=k8
and
f(9)f(25)=f(16)f(25)⋅f(9)f(16)=k2,
so k=1 and f(16)=f(9). This implies that f(2h+1)=f(1)=f(2)=f(2j) for all j,h, so f is constant. From the original functional equation it is then clear that f(n)=1 for all n∈N.