2

$f(x) = \begin{cases} 1 & x \in \mathbb{Q}-\{0\} \\ 2 & x = 0 \\ 3 & x \notin \mathbb{Q} \end{cases}$

$g(x) = \begin{cases} 4 & x \in \mathbb{Q}-\{0\} \\ 2 & x = 0 \\ 3 & x \notin \mathbb{Q} \end{cases}$

I am required to discuss the following for $f$ and $g$.

  1. Continuity and differentiability of $f$ and $g$ at:

    a) $x = x_0 \in \mathbb{Q}-\{0\}$

    b) $x = y_0 \notin \mathbb{Q}$

    c) $x = 0$

  2. Nature of the function (i.e., does it have any extrema?; if yes, then of which type, or is it monotone at …?):

    a) $x = x_0 \in \mathbb{Q}-\{0\}$

    b) $x = y_0 \notin \mathbb{Q}$

    c) $x = 0$

Doubt

My friend told me that his teacher told him for such type of questions that in the just neighborhood of every rational number, there lies an irrational number and vice versa.

But I have a shadow of doubt on this statement because there is nothing like “the immediate neighborhood” of a number. The real line is a continuum, and neighborhoods can be as large or as tiny as you want, that does not make a difference regarding their content.

Moreover, I couldn’t find any theorems regarding my friend’s teacher’s statement. If anyone finds it please let me know in the comments.

If we assume that my friend were right then, My work:

$f(x_0) = 1$

$g(x_0) = 4$

$f(x_0^{+/-}) = 3$

$g(x_0^{+/-}) = 3$


$f(0) = 2$

$g(0) = 2$

$f(0^{+/-}) = 3$

$g(0^{+/-}) = 3$


$f(y_0) = 3$

$g(y_0) = 3$

$f(y_0^{+/-}) = 1$

$g(y_0^{+/-}) = 4$


Also 1 more doubt, in this loosy definition what if we are considering the irrational number to the just side of zero, then $f(y_0^{+/-}) = 3$

$g(y_0^{+/-}) = 3$ are wrong.

I have full gut feelings that all this is wrong and messed up but unfortunately I don’t know if any way to handle these piecewise defined Dirichlet-type functions.

So now clearly for 1 a), b) and c) $f$ isn’t continuous at any of those points. Hence if $f$ is not continuous at a point then it can’t be differentiable at that point. So neither differentiable nor continuous at any of the points.

For 2nd part, My conclusions force me to conclude that $f$ has a local minima at every rational number and a local maxima at every irrational number.

$g$ has a local maxima at every rational number except 0 and local minima at 0 and every irrational number.

I’m actually my self confused whether or not my answers are correct or not. + Require some help regarding the things you felt I am lacking in while reading my work. Thanks in advance.

Rócherz
  • 4,241
  • For you friends comment he is right. You can explicitly find one by using Newton’s method to find the square root of two then substructure the square root of two and add any rational. For the converse, just figue that Q is dense in in the real line (a bit of a loop reasoning here since the real line is defined from Q by completeness). Anyway the statement is true – julio_es_sui_glace May 23 '25 at 22:56

2 Answers2

1

I don't know what your friend meant by "the just neighborhood." If I had to guess, I'd say the meaning was the smallest possible neighborhood about the given value; but (as you point out) there is no such thing. There is always a smaller neighborhood.

But it is a fact that in every neighborhood of every real number $x$ there are both rational and irrational numbers other than $x$ itself.

Consider an arbitrary neighborhood $(x-\delta, x+\delta).$ Because there is a rational number strictly between every two real numbers, there is a rational number strictly between $x$ and $x+\delta,$ which is a rational number other than $x$ in the neighborhood $(x-\delta, x+\delta).$ And because there is an irrational number strictly between every two real numbers, there is an irrational number strictly between $x$ and $x+\delta,$ which is an irrational number other than $x$ in the neighborhood $(x-\delta, x+\delta).$

The rational and irrational numbers shown above are greater than $x$, but similar reasoning with $x-\delta$ and $x$ shows that there are rational and irrational numbers in the same neighborhood that are less than $x.$

So no matter whether whether you're looking at $x = x_0,$ $x = y_0,$ or $x = 0,$ you have both rational and irrational numbers in every neighborhood of $x,$ and at least one of the rational numbers isn't $0.$

This is slightly different from your friend's model, and this affects at least one of your conclusions.

David K
  • 108,155
0

Every neighborhood of every point in R contains both rational and irrational numbers (these two sets are dense in R). That will then make both f and g discontinuous at every point and then non-differentiable also.

As for LOCAL extrema, the funny thing is that they are a sort of NOT local, basically one (usually) requires an interval (open) to discuss local extrema in that (tiny) interval, not at a separate point. I personally allow discussion of local extrema even at isolated points, but that is not what most people would do. In any case the underlying topology on the real line will determine what is happening.

As for the global extrema, both functions obviously have global extrema -- namely their biggest and smallest values respectively.

It may be fun to actually play with these things in non-standard analysis, but that is probably out of your scope.

Rado
  • 287