Consider the intermediate value theorem. It says that a continuous function $f(x)$ on a closed interval $[a,b]$ takes on every value between $f(a)$ and $f(b)$ at least once. Excluding trivialities like $f(x)=\mbox{constant}$, my question is how often can $f(x)$ achieve an intermediate value and still be continuous on $[a,b]$? For any finite number, a continuous function can always be constructed, like sine with a high enough frequency. But is it possible that an intermediate value is achieved by $f(x)$ an infinite number of times? Countable, uncountable number of times?
So looking for a continuous function $f(x)$ on a closed interval $[a,b]$ with $f(a)\neq f(b)$ such that for some $z$ between $f(a)$ and $f(b)$, there exist infinitely many values $c$ in $[a,b]$ for which $f(c)=z$. If such a function is not possible, then perhaps an intuitive argument of its impossibility will help.