Answer
$$f=2\quad \mathrm{or}\quad \:f=8$$
Work Step by Step
Since the value inside the absolute value can be positive or negative and get the same number, we must consider both options. Doing this, we find:
$$\left|f-5\right|=3 \\ f-5=-3\quad \mathrm{or}\quad \:f-5=3 \\ f=2\quad \mathrm{or}\quad \:f=8$$