Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Thank you for the hint towards ring-like functions and the linked article. The concept of ring-like functions was new to me, so I will definitely check them out in more detail. Unfortunately the spaces I had in mind are not compact, so I am not sure if the result can be generalised. In fact in the scenario I have in mind $Y$ is simply an open subset of a Euclidean space, even homeomorphic to it.
Good point, the Cantor function is useful for the construction of space-filling curves. But it is for example not an open mapping. So basically, I was looking for conditions on $f$ that exclude cases like constructions involving the Cantor function.