Let $$f:X \times X \rightarrow Y, f(x,y)= 2^{log|x+y|}$$
a) Define the sets $X,Y \subset \mathbb{R}$ so that the function is defined throughout the domain
b) Characterize the inverse image defined by $f^{-1}([\frac{1}{2},1])$
my attempt:
a) If $x, y> 0$, then $X = Y = \mathbb{R^+}$ is the domain and codomain, so that the function will be surjective. (As a module, I could have done $\mathbb{R^*}$ too, right?)
b) I can not find an easy way to find the inverse image from that point, and the books I have only give examples of very simple functions, usually in $\mathbb{R^2}$. How can I do it?

(a) $x + y\ne 0$ is enough.
(b) $$ (x,y)\in f^{-1}([\frac12,1]) \iff \frac12\le 2^{\log|x + y|}\le 1\iff -\log 2\le\log|x + y|\log 2\le 0\iff $$ $$ -1\le\log|x+y|\le 0\iff e^{-1}\le |x + y|\le 1\iff\cdots $$