Related question:-
My question is a generalization of this question.
WARNINGS:-
$(1)$ This question might not have all the needed tags.
$(2)$ I am not a mathematician. So if this question doesn't make sense then please forgive me.
Clarification of the title of this question:-
Some people might ask what do I mean by
infinitely dense on the real number line.
So let me clarify the title with an example. If you take $\mathbb{Z}$ then it is not infinitely dense because in a finite interval on the real line, there exists only finitely many elements of $\mathbb{Z}$
But if you take, for example $\mathbb{Q}$ then it is infinitely dense because in a finite interval of the real line, there exists infinitely many elements of $\mathbb{Q}$.
How I got interested:-
I started wondering about this question after watching a few youtube videos about roots of a function and fractals.
Let,$\mathcal{R}(f)$ be the set of the roots of $f$
If you take $f=sin(x)$ then $\mathcal{R}(f)$ is infinite but not infinitely dense.
I started thinking about that how cool the graph of a function $f$ would look like if $\mathcal{R}(f)$ is infinitely dense because then the graph would intersect the $x$ axis infinitely many times
My questions:-
$(1)$ Let, $f$ be a continuous function.
Then, does there exist $f$ such that $\mathcal{R}(f)$ is infinitely dense?
$(2)$ If the answer to $(1)$ is "no" then why? If "yes" then how to construct such functions?
(If the question is poorly written in mathematical terms then sorry, I am not a mathematician)