There are examples of functions $f \colon [0,1] \longrightarrow [0,1]$ such that 
for any $\alpha $, $f^{-1}(\lbrace \alpha \rbrace)$ is uncountable. My favorite example is $$f(r) = \limsup\_n \frac{a\_1 + a\_2 +\cdots + a\_n}{n}$$ where $0.a\_1a\_2\cdots$ is the (non-terminated) binary expansion of $r$. 


Is there a continuous function $f \colon [0,1] \longrightarrow \Bbb{R}$ such that for any $\alpha \in \Bbb{R}$, $f^{-1}(\lbrace \alpha \rbrace)$ is (non-empty) perfect ?



Is it possible to have the set $f^{-1}(\lbrace x \rbrace)$ perfect for every $x$?
Existence of such a function goes back to 1939:


**J. Gillies, Note on a conjecture of Erdos, Quart. J. Math. Oxford 10, 1939, 151-154**


Also, it can be shown that there is a residual set (a set whose complement is of first category) of continuous functions on $[0,1]$ such that for any $f$ in that set $f^{-1}(\lbrace \alpha \rbrace)$ is perfect except for countably many $\alpha$ and for each of the exceptional $\alpha 's$, $f^{-1}(\lbrace \alpha \rbrace)$ has the form $P\cup\lbrace t\rbrace$ where $P$ is perfect and $t$ is an isolated point of $f^{-1}(\lbrace \alpha \rbrace)$.


