Note that

$$r(n)=|\{(a,{a}^{\prime}):a,{a}^{\prime}\in A,n=a+{a}^{\prime}\}|$$

$A=\{0,1,2\}$ would work with the interval being $[1,4]$. Then $3\le \sqrt{17}$.

A second part of the question shows that one can prove that $|A|\le \sqrt{N}$ if it satisfies the above conditions. But $3>\sqrt{4}=2$. Does this mean that my set $A$ is wrong?