# Continuity and Differentiability of some functions

On one of my textbooks has the following exercise:

Let $$f$$, $$g$$ and $$h$$ be the next functions:

$$f(x) = \left\{ \begin{array}{cc} 1& x \in \mathbb{Q}\\ 0 & x \in \mathbb{R}\setminus\mathbb{Q}\end{array}\right.\;\;\;\;\;\;\;\;\;\;g(x)=xf(x)\;\;\;\;\;\;\;\;\;\;h(x)=xg(x)$$

Prove that $$g$$ is continuous only on $$x=0$$ and $$h$$ is differentiable also only on $$x=0$$.

I know something about $$f$$: is a Dirichlet function and is not continuous (nor differentiable) everywhere.

I remember this matter from college and I think we proved this by showing that, for every $$x_0\in\mathbb{R}$$, the limit $$\lim_{x\to x_0}f(x)$$ is not well defined so we can't say that $$\lim_{x\to x_0}f(x)=f(x_0)$$ and, by this, we conclude that $$f$$ is not continuous on $$x_0$$.

Since is not continuous on $$x_0$$, $$f$$ is not differentiable on $$x_0$$ as well.

Here's my question: Doesn't the same argument show that $$\lim_{x\to 0}g(x)$$ is not well defined? Or that $$\lim_{x\to 0}\frac{h(x)-h(0)}{x}$$ is also not well defined? How can I state that $$\lim_{x\to 0}g(x)=0$$? Or $$\lim_{x\to 0}\frac{h(x)-h(0)}{x}=0$$?

A similar question has been asked here, however the answers don't provide any formal proof of this particular exercise (nor a leading clue to get it as far as I understand).

Thanks.

Try the sandwich theorem and use $$|f|\leq 1$$, i.e. $$0\leq|g(x)|=|x||f(x)|\leq |x|\rightarrow 0 \mbox{ for }x\rightarrow 0.$$ Can you now do the same for the differential quotient of $$h$$?
There is nothing about $$\lim_{x\to x_0}f(x)$$ which is not well-defined. What happens is that that limit doesn't exist, whatever the number $$x_0$$ is.
The same thing occurs with the function $$g$$ except if $$x_0=0$$. Then we have$$(\forall x\in\mathbb R):\bigl\lvert g(x)\bigr\rvert\leqslant\lvert x\rvert$$and therefore $$\lim_{x\to0}g(x)=0=g(0)$$.
A similar thing occurs with $$h$$.