How to see the ring of all polynomials (with integer coefficients) that are bounded on a given real algebraic set?

Let $S$ be the zero set in $\mathbb{R}^n$ of a polynomial with real coefficients. Let $B$ be the ring of polynomials, with INTEGER coefficients, that are bounded on $S$.

I would like to know how to get basic information about $B$: When is $B=\mathbb{Z}$? When is $B$ finitely generated? How do I find some comprehensible set of ring generators of $B$? Any suggestions or references would be appreciated.

-
Someone care to explain the vote to close? This seems like a perfectly reasonable question to me. – Qiaochu Yuan Apr 14 '10 at 17:37
This is a comment. I might not be as comfortable with the notation, but if $B$ is a ring of polynomials, how can $B = \mathbb Z$? Is $B$ also in $\mathbb R^n$? Can you provide more details on why $B$ is always a ring, as opposed to just a set of polynomials? Finally, what do you mean for a polynomial to be bounded by a set? – Wlog Apr 14 '10 at 19:25
@Wlog: the question is clear. B is "the ring of polynomials with integer coefficients that happen to have property X" which I think is perfectly clear. If no non-constant polynomials have property X then B is the integers. Being "bounded on S" means that there is a constant C such that |p(s)|<=C for all s in S. – Kevin Buzzard Apr 14 '10 at 19:42
@Wlog: A polynomial $p$ is "bounded" on a subset $S$ of $\mathbb{R}^n$ if for some real $r$, the inequality $|p(x)| < r$ holds for every $x$ in $S$. How could $B=\mathbb{Z}$? For example, consider the line $y=\pi x$ in $\mathbb{R}^2$. If a non-constant polynomial $f(x,y)$ with integer coefficients was bounded on that line, then $f(x,\pi x)$ would reduce to a constant, which would imply that $pi$ is rational. So in this case $B=\mathbb{Z}$. – SJR Apr 14 '10 at 19:46
@Kevin: We posted simultaneously. – SJR Apr 14 '10 at 19:55

Let $\bar{S}$ by the closure of S in $\mathbb{P}^n(\mathbb{R})$. If a polynomial with zero constant term is bounded on S, then its highest degree term vanishes on $S':=\bar{S} \setminus S \subset \mathbb{P}^{n-1}$. In particular, if S' is Zariski dense in $\mathbb{P}^{n-1}$ over Z, then B=Z (classically, sets with similar properties were called "generic"). On the other hand, S' could be defined over $\overline{\mathbb{Q}}$ even when S is not (e.g. $y^2=\pi x$).
Since obviously $B \neq \mathbb{Z}$ in the case in which $B \neq \mathbb{R}^n$ and B is defined over $\overline{\mathbb{Q}}$, it would be interesting to find an irreducible S not defined over $\overline{\mathbb{Q}}$ which is unbounded (i.e. $S' \neq \emptyset$) and for which $B \neq \mathbb{Z}$.
Your example works for what I asked, even though I would have wanted an example in the n=2 case. Also, the ideal of all polynomials vanishing on the S you described is generated by the two linear terms in the equation (you do not care about non-reducedness, nor about complex points). In your case, the "trace at infinity" of S is contained in the vanishing set of y-sqrt(2)x and it is maybe $\mathbb{Z}$-dense in there. I would have wanted an example which is "genuinely" not defined over $\mathbb{Q}$: in some sense, the example you gave has one "side" defined over Q and one which isn't. – damiano Apr 15 '10 at 11:45