-1

How do I prove for the following functions that $f$ is only continuous in $\frac{1}{2}$ and that $g$ is continuous in all irrational $x$ and in $0$? $$f(x) = \begin{cases} x, x \in \mathbb{Q} \\ 1-x, x \notin \mathbb{Q} \end{cases} \ \,, \ \ \ g(x) = \begin{cases} \frac{1}{q}, x= \frac{p}{q} \in \mathbb{Q}\setminus \{0\} \ and \ p,q \in \mathbb{Z} \ coprime, q>0, \\ 0, x \in \mathbb{R} \setminus \mathbb{Q} \ \cup \ \{ 0 \} \end{cases} $$

I really get confused because I'm not sure how to handle the $\in \mathbb{Q}$ part of the first function and I'm absolutely lost how to prove it for the second function. Thank you for your help :).

Val
  • 13
  • 3

2 Answers2

0

The function $f$

Note that $f(\frac{1}{2})=\frac{1}{2}$ and $f(\frac{1}{2}+y)=\frac{1}{2}\pm y$ depending on whether $\frac{1}{2}+y$ is rational or irrational. So for any $x$, rational or irrational, we have $|f(x)-f(\frac{1}{2})|=|x-\frac{1}{2}|$. So $f$ is continuous at $\frac{1}{2}$.

Suppose $x>\frac{1}{2}$ and rational. So $f(x)=x>\frac{1}{2}$. If $f$ is continuous at $x$, then we can find $\delta>0$ such that for any $y$ with $|x-y|<\delta$ we have $|f(x)-f(y)|<x-\frac{1}{2}$.

But now take any irrational $y>x$. We can certainly find such $y$ satisfying $|y-x|<\delta$. But $f(y)=1-y<1-x<\frac{1}{2}$. So $f(x)>f(y)$ and $f(x)-f(y)=x-f(y)>x-\frac{1}{2}$. Contradiction.

Similarly if $x>\frac{1}{2}$ and irrational, then $f(x)=1-x<\frac{1}{2}$. Again if $f$ is continuous we can find $\delta>0$ such that $|f(x)-f(y)|<x-\frac{1}{2}$ for all $y$ satisfying $|x-y|<\delta$. But take any rational $y$ such that $x<y<x+\delta$. Then $f(y)=y>\frac{1}{2}$, so $|f(x)-f(y)|=f(y)-f(x)=y-f(x)>y-\frac{1}{2}>x-\frac{1}{2}$. Contradiction.

So we have established that $f$ is not continuous at any $x>\frac{1}{2}$. A similar argument shows that it is not continuous at any $x<\frac{1}{2}$.

The function g

Suppose $x$ is rational and non-zero. Then $g(x)=\frac{1}{q}$ for some positive integer $q$. But there are irrational points $y$ arbitrarily close to $x$ and at those $g(y)=0$, so there cannot exist $\delta>0$ such that $|g(y)-g(x)|<\frac{1}{2q}$ for all $y$ such that $|x-y|<\delta$. So $g$ is not continuous at non-zero rational points.

Now suppose $x$ is irrational or 0, so that $g(x)=0$. Take any $\epsilon>0$. There are only finitely many rational points in the interval $(x-1,x+1)$ with denominator $\le\frac{1}{\epsilon}$. Take $\delta>0$ sufficiently small that none of those points lie in $(x-\delta,x+\delta)$. Then any point $y$ in that interval is either irrational in which case $g(y)=0=g(x)$ or has denominator $>\frac{1}{\epsilon}$ and hence $g(y)<\epsilon$ and so $|g(x)-g(y)|<\epsilon$. That proves $g$ is continuous at $x$.

almagest
  • 18,380
0

To begin with, the $\in \mathbb{Q}$ simply means "is rational", and likewise, $\notin \mathbb{Q}$ means "is not rational" i.e. "is irrational".

Now, consider the following (slightly simpler) function:

$$h(x) = \begin{cases} x, x \in \mathbb{Q} \\ -x, x \notin \mathbb{Q} \end{cases}$$

This function is continuous only at the point $x=0$, because for any nonzero value $y$, there are an infinite number of irrational numbers between any pair of rationals, so the sequence will not converge and the $\lim_{y \to\ x} h(x)$ therefore cannot exist.

However, as $0$ is rational, we also know that $h(0)=0$ from our definition of $h(x)$. Furthermore, as $h(x)$ is always defined as either $x$ or $-x$, we know that $-|x| \le h(x) \le |x|$. As $\lim_{x \to\ 0} |x| = \lim_{x \to\ 0} -|x| = 0$ the squeeze theorem tells us that:

$$\lim_{x \to\ 0} h(x) = 0$$

As this is equal to $h(0)$, this proves that $h$ is continuous at $0$.

The same general approach can be used to tackle $f(x)$ in the first part of your question; the only difference between $f(x)$ and $h(x)$ is that $f(x)$ where $x \notin \mathbb{Q}$ is defined as $1-x$ rather than $-x$. Note that:

$$\lim_{x \to\ \frac{1}{2}^{+}} f(x) = \lim_{x \to\ \frac{1}{2}^{-}} f(x) = \frac{1}{2}$$

Having dealt with $f(x)$, now only $g(x)$ remains. First, we know that $g(0) = 0$ by definition. We can also see that regardless of whether $x$ is rational or irrational, $\lim_{x \to\ 0} g(x)$ converges to $0$, so clearly it is continuous at $0$. The final remaining step is to prove that $g(x)$ is continuous when $x \notin \mathbb{Q}$. For any irrational value of $x$, we know that $g(x)$ is $0$, so in order for $g$ to be continuous we must establish that the following tends to $0$:

$$g(x) = \frac{1}{q}, x= \frac{p}{q} \in \mathbb{Q}\setminus \{0\} \ and \ p,q \in \mathbb{Z} \ coprime, q>0$$

Remember that $q > 0$. If we wish to take the limit as $x$ approaches an irrational value and we do so with a sequence of rationals (with numerator and denominator coprime), recognize that in order to get our approximations closer and closer to the desired (irrational) value, we will need to invoke larger and larger values of $q$. Finally, note that:

$$\lim_{q \to\ \infty} \frac{1}{q} = 0$$

As this is equal to $g(x)$ when $x$ is irrational, we have proven that $g(x)$ is continuous for irrational $x$.

Justin
  • 16
  • 1