# Real algebraic surface

Let $f(u,v,z)\in \mathbb{Q}[u,v,z]$ be a polynomial in three variables such that $X_{\mathbb{R}}\subset \mathbb{R}^{3}$ (the associated surface of real solution) is smooth. Suppose that the set of rational solutions $X_{\mathbb{Q}}$ is dense in $X_{\mathbb{R}}$. My question is the following:

Is there an open set $U\subset X_{\mathbb{R}}$ such that locally we have a diffeomorphism

$$g: V\subset \mathbb{R}^{2}\longrightarrow U$$ such that

$$g(x,y)= (\frac{P_{1}(x,y)}{Q_{1}(x,y)},\frac{P_{2}(x,y)}{Q_{2}(x,y)}, \frac{P_{3}(x,y)}{Q_{3}(x,y)})$$ where $P_{i}$ and $Q_{i}$ are in $\mathbb{Q}[x,y]$

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$.