# Domain and range of constant function

I found a constant function $$f(x) = \frac{x-2}{2-x} = (-1)$$ and here we can see that $$f(x)$$ is defined for every value of $$x$$ except 2.
Therefore,$$\mathbb{dom}(f(x)) = \mathbb{R} - \{2\}$$ And for range of $$f(x)$$ $$\mathbb{range}(f(x)) = -1$$ Now, $$f(x) = \frac{x-2}{2-x}=y$$ $$x = g(y) = \frac{2y+2}{y+1} = 2$$ And $$g(y)$$ is defined for all values of $$y$$ except $$(-1)$$.
Therefore$$\mathbb{dom}(g(y)) = \mathbb{{R}} - \{-1\}$$ And $$\mathbb{range}(g(y)) = 2$$ Thus we can conclude that range of $$g$$ is that value which is not in domain of $$f$$ and range of $$f$$ is that value which is not in domain of $$g$$.
So is this correct as I observed this for functions that cancel out and become a constant function.
Any help would be appreciated.

• Could you please explain that what do you mean with if a function is not 1-1 and onto Oct 5, 2021 at 5:49
• It looks like you are solving for the inverse of a function that does not have an inverse, which is why you are getting a strange result. Oct 5, 2021 at 9:15

The point is, I guess, that both $$f\circ g$$ and $$g\circ f$$ have empty domain.