At x=0, the rule changes from mx2+n to nx+m.
x→0−limf(x)=x→0−lim(mx2+n)
=n
x→0+limf(x)=x→0+lim(nx+m)
=m
So x→0limf(x) exists only when m=n.
At x=1, the rule changes from nx+m to nx3+m.
x→1−limf(x)=x→1−lim(nx+m)
=n+m
x→1+limf(x)=x→1+lim(nx3+m)
=n+m
These are equal for all m and n, so x→1limf(x) always exists.
∴ Both limits exist exactly when m=n. So m and n can be any two equal integers.