Counterexample: Continuous function with level sets of Lebesgue measure zero Let $f:[0,1] \rightarrow \mathbb{R}$ be a continuous function. It is given that it has "no flat regions", i.e. its level sets have empty interiors. My question is, must it mean that each of its level sets has Lebesgue measure zero? In other words, can a continuous function with "no flat regions" have level sets which have positive Lebesgue measure?
Somewhere on this site I read a comment to a question that said a continuous function can have, as one of its level sets, the fat Cantor set, which has empty interior but positive Lebesgue measure. Unfortunately I can't find it now, and the comment also did not give an actual example.
Any example is most appreciated.
 A: Take
$$\operatorname{dist}(x,{\mathcal F}):=\inf_{y\in\mathcal F}|x-y|$$
where $\operatorname{dist}$ is the distance function and $\mathcal F$ is the fat Cantor set. Since $\mathcal F$ is closed, this function is zero precisely on $\mathcal F$.
EDIT: The construction of a fat Cantor set is outlined here.
A: An idea
Suppose we have a fat Cantor set $\mathcal F\subset[0,1]$, which has empty interior. We can define a function $f$ that is $0$ on $\mathcal F$. The complement of $\mathcal F$ in $[0,1]$ is a union of open intervals. For each interval, let $f$ be a continuous function that looks like "$\land$" on it with $0$ at boundaries.
This idea is also stated by as Sassatelli Giulio.
A fat cantor set
For any $a=\sum _{k=1}^\infty a_{k}2^{-k^2}\in[0,1]$, where $a_k=\lfloor2^{k^2}a-2^{2k-1}\lfloor2^{(k-1)^2}a\rfloor\rfloor\in\{0,1, 2, \cdots, 2^{2k-1}-1\}$. In terms of positional notation system,
$$a=a_1a_2a_3a_4\cdots,$$
where the weight of each position is respectively $\frac1{2^1},\frac1{2^4},\frac1{2^9},\frac1{2^{16}},\cdots.$
Consider $\mathcal F=\{\sum _{k=1}^\infty a_{k}2^{-k^2}: a_k\in\{0,1, 2, \cdots, 2^{2k-1}-1\}, a_k\not=2^{2k-2}\}\subset[0,1]$. In plain words, we start with $[0,1]$. At round $k\in\{1,2,\cdots\}$, for each remaining intervals, we split it into $2^{2k-1}$ equal pieces and then take away the interior of one of the pieces in the middle. All the points that have never been taken away form $\mathcal F$.
$\ \mathcal F$ is a fat Cantor set with Lebesgue measure
$$\prod_{k=1}^{\infty}\frac{2^{2k-1}-1}{2^{2k-1}}>1-\sum_{k=1}^{\infty}\frac1{2^{2k-1}}=\frac13.$$
A continuous function $f$ with $f^{-1}(0)$ having positive lebsegue measure
Suppose $a\in[0,1], a\notin\mathcal F$. Since $\mathcal F$ is a closed subset of $\Bbb R$, there are open intervals that are disjoint with $\mathcal F$ that contain $a$. Let $(\ell_a,r_a)$ be the biggest one of them.
Define $f:[0,1]\to\Bbb R$,
$$f(a)=\begin{cases}
0&\text{if }a\in\mathcal F,\\
(\ell_a+r_a)/2-|a-(\ell_a+r_a)/2|&\text{if }a\notin\mathcal F.\\
\end{cases}$$
$f$ is continuous.
$f^{-1}(a)$ is finite if $a\not=0$.
$f^{-1}(0)=\mathcal F$, a fat Cantor set with Lebseque measure $>\frac13$.
All level sets of $f$ have empty interiors.
