The answer to your question is negative.
To discuss it, let me make in what follows the additional assumption that the associated projective variety $Y\subset\mathbb{P}^3_{\mathbb{R}}$ is smooth, and let me denote by $d$ the degree of $f$.

Then, the existence of $g$ implies that $Y_{\mathbb{C}}$ is a unirational complex variety. This cannot happen if $d\geq 4$ because $Y_{\mathbb{C}}$ carries a non-trivial $2$-differential form.

When $d\geq 5$, it is expected (but unknown and difficult), that the rational points cannot be dense (even for the Zariski topology). Thus conjecturally, you cannot hope for a counter-example if $d\geq 5$.

On the other hand, when $d=4$, $Y$ is a K3 surface, and it is really possible that the rational points are dense in the real points (for the Zariski topology or even, as you ask, for the euclidean topology). A concrete example is given in [Elkies, On $A^4+B^4+C^4=D^4$], showing that a counterexample to your question is given by $u^4+v^4+z^4-1$.

Finally, let me indicate that when $d=3$ (and if we insist, in your question, that the whole of $Y$ is smooth), the question has a positive answer, going back to [Segre, A note on arithmetical properties of cubic surfaces] : a cubic surface that has a rational point is unirational. This is also the case, and easy, if $d=2$ or $1$.