Find an example of a continuous function $f: [0,1] \to [0,1]$ such that:
- $f(0) = 0$
- $f(1) = 1$
- $f$ is locally constant almost everywhere
I know I need to come up with a function that fails to be locally constant on some subset of $[0,1]$ which has measure zero, but I'm struggling to see how any such function would remain continuous when it still has to be locally constant outside this subset. Any tips would be appreciated.