Do we say that a function $f$ is uniformly almost periodic in the aforementioned proof if $f$ is bounded (in the sense that $||f||_{L^\infty}\leq 1$) and that there exists a natural number $d>0$ such that $f\in UAP^d$?

Well, the setting in Tao's proof is finitary, in the sense that the function $f$ above is defined on a finite cyclic group $Z_N$. Thus, continuous functions on the Bohr compactification of the reals might not be the answer.
–
user4949Dec 13 '10 at 14:54