Tricky question about limit of a function

81 Views Asked by At

In my Calculus home work assignment I get the following tricky question about the limit of following function:


Define a function $f : \mathbb{R} \rightarrow \mathbb{R}$ as follows:

  • if $x \in \mathbb{R}\setminus\mathbb{Q}$, then $f(x) = 0$.
  • if $x \in \mathbb{Q}$, let $p \in \mathbb{Z}$, $q \in \mathbb{N}$ such that $x = \frac{p}{q}$ is the reduced form of $x$. Then $f(x) = \frac{1}{q}$.

Prove that $lim_{x \rightarrow x_0} f(x) = 0$ for every $x_0 \in \mathbb{R}$.

Hint: You may rely on the following claim:

Let $k,d > 0$ be positive real numbers, and let $x_0 \in \mathbb{R}$. There is finite number of integers $p \in \mathbb{Z}$, $q \in \mathbb{N}$, such that $q \leq k$ and $ \left| x_0 - \frac{p}{q} \right| < d$.


I'm struggling with this question 3 days already. Intuitively I understand that for every $\epsilon > 0$ I can choose $\delta > 0$ small enough, such that $\frac{1}{q} < \epsilon$, but I'm really struggling to put condition on $\delta$.

2

There are 2 best solutions below

1
On

Consider the number $n!$ (for some given $n \in \Bbb N$).

For each number $x_0 \in \Bbb R$, there must exist $a \in \Bbb Z$ such that

$$\frac{a}{n!}<x_0 \leq \frac{a+1}{n!}$$

Note that $a$ depends on both $x_0$ and $n$.

Also, observe that $f(x)<\frac 1n$ in each such interval $\big(\frac{a}{n!} , \frac{a+1}{n!} \big)$. Thus,

\begin{align} & \forall \varepsilon >0 \; \; \exists \; \delta = \min \bigg \{ \bigg| x_0 - \frac{a}{\big(\lceil\frac 1\varepsilon \rceil \big)!} \bigg| \;, \; \bigg| x_0 - \frac{a+1}{\big(\lceil\frac 1\varepsilon \rceil \big)!} \bigg| \bigg \} >0 \; \text{ such that } \\ \; |x-x_0|<\delta & \implies \frac{a}{\big(\lceil\frac 1\varepsilon \rceil \big)!} < x< \frac{a+1}{\big(\lceil\frac 1\varepsilon \rceil \big)!} \\ & \implies |f(x)-0| = f(x)<\frac{1}{\lceil \frac 1\varepsilon \rceil} \leq \varepsilon \end{align}

0
On

I think @glowstonetrees's answer isn't quite right: given an arbitrary $x_0 \in \mathbb R$, we only know that $x_0 \in (\frac{a}{n!},\frac{a+1}{n!}]$, hence it is not enough to claim $f(x)<1/n$ for $x \in (\frac{a}{n!},\frac{a+1}{n!})$. Moreover, it is not true that if $x \in (\frac{a}{n!},\frac{a+1}{n!}]$ then $f(x)<1/n$: if $n=3$ and $a=2$ then $3/6 \in (2/6,3/6]$ and $f(3/6) = 1/2>1/3$. (There is also a related issue about the definition of $\delta>0$ when $x_0$ is equal to one of $\{\frac{a}{\lceil 1/\epsilon\rceil !}, \frac{a+1}{\lceil 1/ \epsilon\rceil!}\}$.)

These are only technicalities however, the strategy of the proof is easy to fix: Note that for all $p,q\in \mathbb N$ $$ \text{g.c.d.}(p,q) = \text{g.c.d.}(p+q,q), $$ and hence $f(\frac{p+q}{q}) = f(\frac{p}{q})=1/q$. It follows that $f(x) = f(x+1)$ and hence $f$ descends to a function on the circle $S=[0,1]/\{0 \sim 1\}$ obtained by identifying the endpoints $0$ and $1$ of the unit interval $[0,1]$. We may thus assume that $x_0 \in [0,1)$.

Now if $\epsilon>0$ are given, then setting $N=\text{max}\{1,\lceil 1/\epsilon\rceil\} \geq 1$, note that the set $S_N = \{x \in [0,1]: f(x) = 1/n\geq 1/N\}$ is finite (indeed $|S_N|\leq N!$). But then if

$$ r = \min\{|x_0-q|: q\in S_N\backslash \{x_0\} \} $$ we see that if $|x_0-y|<r$ then $|f(z)|<1/N\leq \epsilon$. It follows that $\lim_{y \to z} f(y)=0$ as required.

[This fix is lazier than the approach taken in glowstonetree's answer because I don't make any attempt to estimate the size of $r$. ]