infinite value-crossings for continuous function

The $\Bbb R \to \Bbb R$ function
$$
f(x) = \begin{cases}0 & x = 0 \\
x \sin \frac{1}{x} & x \ne 0\end{cases}
$$
crosses the horizontal line $y = 0$ infinitely often. (It happens to cross many other horizontal lines infinitely often, but its restriction to any closed interval does not cross any others infinitely often, which is what interests me.)

If we define $$g(x) = f(x) + x f(x-\pi),$$ then $g$ crosses both $y = 0$ and $y = \pi$ infinitely often. Clearly, I can construct, by analogous methods, functions on closed intervals that cross any finite number of lines infinitely often. (And $f$ itself does so for every horizontal line, once we remove the restriction of the closed-interval domain.)

This motivates me to ask:

Suppose that $f : [0, 1] \to \Bbb R$ is continuous. Is it possible for the preimages of infinitely many points in $\Bbb R$ to each be infinite? Is it possible for the preimages of uncountably many points in $\Bbb R$ to be infinite?

I have a feeling that this should actually be an easy analysis question, but … it’s been too long since I studied analysis.

The motivation:

In Closed loop on the sphere is homotopic to a product of homeomorphisms onto great arcs of the sphere, the poster mistakenly believed that a space-filling curve on the sphere must “cross from $U$ to $V$ infinitely often”, where $U$ and $V$ are two open sets that form a cover of the sphere, and while I was able to address the misunderstanding, it led me to the question above.

Solutions Collecting From Web of "infinite value-crossings for continuous function"