Just as an illustrative example of what we can do, consider the Cantor staircase function $f$ and let $g$ be its “inverse” where for each dyadic $r$ (i.e., every “step” of the staircase) we let $g(r)$ be the smallest $x$ such that $f(x)=r$ (and for non-dyadic $y$ we let $g(y)$ be the unique $x$ such that $f(x)=y$). Then the image of $g$ is the Cantor set minus the right endpoints of all the components of its complement.
↧