Finding the inverse of $f(x)=|x|-2$ How would I find the inverse of the function $f(x)=|x|-2$? I have swapped $x$ and $y$, and tried to isolate $y$, reaching up to $x+2=|y|$

Whenever I see absolute values, I always break the problem up into cases.

Case $1$: $y\ge 0$, $|y|=y$

$y=x+2$

Case $2$: $y&lt;0$, $|y|=-y$

$-y=x+2$
$\implies y=-x-2$

It doesn't seem right that I get two answers... Am I supposed to combine the two into one piecewise function like:

$$f^{-1}(x)=\begin{cases}x+2, \ x\ge 0 \\ -x-2, \ x&lt;0 \\ \end{cases}$$

Any hints on how to do this?

Also, just to clarify, my homework assignment asks me to "Graph the inverse of $f(x)=|x|-2$"
$y=|x|-2$ is not one-to-one and hence not invertible. You can easily see this by comparing the values of the function at $-1$ and $1$ or simply drawing its graph: it doesn't pass the horizontal line test.
Maybe your homework is asking to reflect the graph of $|x|-2$ in $y=x$. This won't be a function but it will do the job.



Can you guess which graph(s) you want?