Proving a function is always nonnegative 
Suppose $f : \mathbb{R}^{n} \rightarrow \mathbb{R}$ is continuous and
  $f(u) > 0$ if the point $u \in \mathbb{R}^{n}$ has at least one
  rational component. Prove that $f(u) \geq 0 $ for all $u \in
\mathbb{R}^{n}$.

Partial Solution:
What remains to be proven is that $f(u) \geq 0$ for every $u \in \mathbb{R}^{n}$ with at all irrational components. Let $v$ be such a vector. Since every real number is the limit point of a rational sequence, we can define sequences $\{r_{1}\}, \{r_{2}\}, \ldots, \{r_{n}\},$ where $\{r_{k}\}$ converges to the $k^{\text{th}}$ component of $v$. 

I don't really know how to finish from here. Can someone please help me?
 A: Let's try to prove a stronger result: 

Theorem. Suppose $f : \mathbb{R}^{n} \rightarrow \mathbb{R}$ is continuous and
  $f(u) > 0$ if the point $u \in \mathbb{R}^{n}$ has all its components rational. Then $f(u) \geq 0 $ for all $u \in
\mathbb{R}^{n}$.

Proof. Let $v=(v_1,v_2,...,v_n)\in\mathbb{R}^n$. Choose rational sequences ${x_{mk}}$ such that $\lim_{k\to \infty}x_{mk}=v_m$, for all $m=1,2,...,n$. The sequence of points $x_k=(x_{1k},...,x_{nk})$. Please tell me if you want to know in details why such choice is possible.
Then $x_k \to v$. Since $f$ is continuous, $f(x_k) \to f(v)$. We know that $f(x_k)>0$ for all $k$. To show that $f(v)\geq0$, suppose that $f(v)<0$. Then for all $k$, $|f(x_k)-f(v)|\geq|f(v)|$. This is a contradiction, because for $f(x_k) \to f(v)$, there should exist $k_0$ such that for any $k\geq k_0$, $|f(x_k)-f(v)|\leq|f(v)|$. Here, we take $|f(v)|>0$ as the arbitrary number $\epsilon>0$.
Note. The strict inequality becomes NOT strict after taking the limit. We can actually find examples to show that equality can hold in $f(u) \geq 0 $.
A: For fixed $v \in \mathbb{R}^n$ write $v=(v^{(1)},\ldots,v^{(n)})$, i.e. $v^{(k)}$ is the $k$-th component of $v$ for $k \in \{1,\ldots,n\}$. 
As you suggest, we choose for some some $k \in \{1,\ldots,n\}$ a rational sequence $(r_i)_{i \in \mathbb{N}}$ such that $r_i$ converges to $v^{(k)}$ as $i \to \infty$. Now define $$u_i := (v^{(1)},\ldots,v^{(k-1)},r_i, v^{(k+1)},\ldots,v^{(n)})$$ for $i \geq 1$. By construction, we have $f(u_i) \geq 0$ for all $i$ and $u_i \to v$ as $i \to \infty$.
Hint: Use the continuity of $f$ to conclude that $f(v) \geq 0$. (How can you express $f(v)$ in terms of $f(u_i)$?)
A: Hint: Every $u\in\Bbb{R}^n$ is the limit of a sequence $(u_k)_k$ where each of the $u_k$ has at least one rational component, and hence $f(u)=\lim_{k\to\infty}f(u_k)\geq0$.
