Let $C$ be the Cantor set as a compact Abelian topological group, isomorphic to countable product of $\mathbb{Z}/2\mathbb{Z}$.
Its normalized Haar measure is denoted by $\mu$.
Is there a positive continuous map $f:C \to \mathbb{Q}$ which is not a locally constant map but satisfy $\int_{C} f^{2}d\mu=1 $?
Is there a positive continuous map $f:C \to \mathbb{Q}$ which is not a locally constant map but satisfy $\int_{C} f^{3}d\mu=1 $?
In the other word does $\int_{C} f^{2}d\mu=1 $ or $\int_{C} f^{3}d\mu=1 $ imply that $f$ is locally constant?
This question can be considered as a generalization of the equation $\sum_{i=1}^{n} x_{i}^{2}=1$ or $\sum_{i=1}^{n} x_{i}^{3}=1$ on $\mathbb{Q}^{n}$.