Answer
Conditions
Either
$f(x) = |x| = x$ for $x \ge 0$
OR
$f(x) = |x| = -x$ for $x \le 0$
Then Inverse functions
$f^{-1}(x) = x$ for $x \ge 0$
In second case
$f^{-1}(x) = -x$ for $x \le 0$
Work Step by Step
Function $f(x) = |x|$ is not one to one as
$f(x) = f(-x) $
But it will become one to one if we put restriction on domain
Like
Either
$f(x) = |x| = x$ for $x \ge 0$
OR
$f(x) = |x| = -x$ for $x \le 0$
But not both
It is very simple that,
Inverse function in first case will be
$f^{-1}(x) = x$ for $x \ge 0$
In second case
$f^{-1}(x) = -x$ for $x \le 0$