The function \( f(x) = |x - 1| \) is a piecewise function:
\[
f(x) = \begin{cases}
x - 1, & x \geq 1
1 - x, & x<1
\end{cases}
\]
Step 1: Check if the function is one-one.
For a function to be one-one, it must not take the same value for different inputs. However, for \( x = 0 \) and \( x = 2 \), both give \( f(0) = f(2) = 1 \). Therefore, the function is not one-one.
Step 2: Check if the function is onto.
For a function to be onto, every element in the codomain (in this case, \( \mathbb{R} \)) must have a corresponding element in the domain. The function \( f(x) = |x - 1| \) only takes non-negative values, so it cannot cover all of \( \mathbb{R} \). Therefore, the function is not onto.
Hence, the function is neither one-one nor onto.