Let $\Sigma$ be a finite set. Let $\Sigma^*$ be a set of finite strings in $\Sigma$.
Is there a map $f:\Sigma\to \{0, 1\}^*$ such that the concatenated map $f^*:\Sigma^*\to \{0, 1\}^*$ has the property that for all $\sigma\in\Sigma, s\in \Sigma^*$ the number of times $\sigma$ occurs in $s$ is equal to the number of times $f^*(\sigma)=f(\sigma)$ occurs in $f^*(s)$ as a contiguous substring?