Confused about interval notation

I have a function $f$ and a subset $A$ of its domain, $f(A)$ representing its range.

Letting $f(x) = x^2$ and $A = [0,2]$, is it correct to calculate range $f(A)$ like this:

$A = [0,2] \implies f(A) = [(0)^2, (2)^2] = [0,4]$ ?

The answer $[0,4]$ is correct, however, a problem arises if we now let $A = [-2,2]$ instead:

$A = [-2,2] \implies f(A) = [(-2)^2, (2)^2] = [4,4]$.

The answer here is obviously wrong and $f(A)$ should equal $[0,4]$. How do I reconcile this result with my above calculation, if possible?


Solution 1:

There is just no reason $f([0,2])$ should be $[f(0),f(2)]$, other than that it looks like it could be true. By definition, $f(A)$ is the set of all numbers $f(a)$ for all possible $a\in A$. In general, there is no shortcut to computing $f(A)$ if you know $A$. When $A$ is an interval, for example there is no reason $f(A)$ is an interval. For this reason, there is no algorithmic way to find $f(A)$. Instead, you must make an educated guess and then prove it is correct.

You can probably convince yourself that $f([-2,2])$ should be $[0,4]$, and to prove this there are two steps: show $f([-2,2])\subseteq[0,4]$, and then show $[0,4]\subseteq f([-2,2])$. How you proceed depends on how rigorous you need to be. You might show that $0<a<b$ implies $0\le a^2\le b^2$, and thus $x\in [0,2]$ implies $f(x)\in [0,4]$. Use symmetry to also show $x\in[-2,0]$ implies $f(x)\in[0,4]$. For the other direction, you need to know that nonnegative real numbers have positive square roots, $0\le a\le b$ implies $0<\sqrt a\le \sqrt b$, etc.