Problem 1: Minimizing the absolute value of a function:
$$\min_x |f(x)|$$
Problem 2: Minimizing the function subject to a non-negative constraint:
$$\min_x f(x)\;:\;f(x) \ge 0$$
Could someone please provide an example where the solutions ($x^* = \arg \min f(x)$) of Problem 1 and Problem 2 differ OR a proof why the solutions are the same for any $f(x)$? I understand that Problem 1 allows negative $f(x)$, while negative $f(x)$ are not considered in Problem 2. I'm wondering if these two formulations can lead to different solutions in certain cases.
Thank you in advance for your help!
$f(x) = x + \frac{1}{x} + 1$ is a more useful example for your question. $0$ is not in the range of $f(x)$ and $f(x)$ is not continuous. Problem 1 would yield a minimum of $1$ at $x^* = -1$. But problem 2 would yield a minimum of $3$ at $x^* = 1$.