If we allow $f$ to be discontinuous, then the answer is **yes**: $f$ need not be differentiable. We can choose $a(x)$ and $b(y)$ so that their ranges $A$ and $B$ are Cantor-like sets which have the following property: $$ \text{if $\alpha, \alpha' \in A$ and $\beta, \beta' \in B$, and $\alpha + \beta = \alpha' + \beta'$, then $\alpha = \alpha'$ and $\beta = \beta'$.} $$ Then $f(x, y) = f(x', y')$ implies $x = x'$ and $y = y'$: just use the above property with $\alpha = a(x)$, $\beta = b(y)$, $\alpha' = a(x')$, $\beta' = b(y')$. This means that the scale-invariance property is trivially satisfied. Examples of such sets $A$ and $B$ are easy to construct using decimal expansions. For instance, $A$ can be the set of real numbers which can be written using only $0$ and $1$, while $B$ — with $0$ and $2$. Then the function $a(x)$ can be defined as follows: in order to compute $a(x)$, write the binary expansion of $x$ and interpret it as the decimal expansion of $a(x)$. The function $b(y)$ can be defined in a similar way, or simply as $b(y) = 2 a(y)$.