  In 1902, P. St\"ackel proved the existence of a transcendental function
$f(z)$, analytic in a neighbourhood of the origin, and with the property that
both $f(z)$ and its inverse function assume, in this neighbourhood, algebraic
values at all algebraic points. Based on this result, in 1976, K. Mahler raised
the question of the existence of such functions which are analytic in
$\mathbb{C}$. Recently, the authors answered positively this question. In this
paper, we prove a much stronger version of this result by considering other
subsets of $\mathbb{C}$.
