# uniform convergence, pointwise limit

Define a sequence of functions $f_n: (0,1)\rightarrow\mathbb{R}$ by
$\ f(x) = \begin{cases} 1/q^n & \text{if } x =p/q \space(\space\mathrm{nonzero})\\ 0 & \text{otherwise} \end{cases}$
Find the pointwise limit $f$ of $\{f_n\}$ and show $\{f_n\}$ converges uniformly.

$f$ looks like a modification of Thomae's function to me, but I can't see how a function that converges uniformly can also have a pointwise limit -- I thought uniform convergence was a stronger type of convergence?

For every irrational $x \in (0,1)$, $$\lim_{n \to \infty} f_n(x) = 0$$ is obvious. For a rational $x = \frac{p}{q}$, its again easy to see that $$\lim_{n \to \infty} f_n(x) = \lim_{n \to \infty} \frac{p}{q^n} = 0$$
Thus the pointwise limit is $0$ at all $x \in (0,1)$.
To show uniform convergence, note that $f_1(x) \leq 1$ for all $x$. Also $f_2(x) \leq \frac{1}{2}$ and so on, its easy to see (since for any rational $\frac{p}{q}$, $q \geq 2$) that $$f_n(x) \leq \frac{1}{2^n}$$
Now given $\epsilon > 0$, choose $N$ such that $$\frac{1}{2^N} < \epsilon$$ and you're done.
Uniform convergence means that $\forall \epsilon>0$ there is an $N$ such that $|f_n(x)-f(x)|<\epsilon$ for all $n\geq N$ and for all $x$(the point is that $N$ does not depend on $x$). So uniform convergence imply point wise limit convergence.