Q:

bounded function proof

I tried to prove this:
$f(x)$ is bounded $\Leftrightarrow$ There is $K$ such that $|f(x)| \leq K$ (for every $x\in D$ )
this is what I tried:
=>
$f(x)$ is bounded.
if $f(x)$ is bounded, there is $K1$ such that $f(x) \geq K1.$
if $f(x)$ is bounded, there is $K2$ such that $f(x) \leq K2.$
I know that I have to get something like that $ K \leq f(x) \leq K $ because this is the absolute value's definition , but I have 2 different $K$ ! how can I continue from here?

A:

Note that if $f(x)\le K_1$ for all $x,$ then for any $M\ge K_1,$ we also have $f(x)\le M$ for all $x.$ On the other hand, if $f(x)\ge K_2$ for all $x,$ then for any $N\le K_2,$ we have $f(x)\ge N$ for all $x.$ (If you can't see why this is true, draw a picture.)
Letting $K=\max\{|K_1|,|K_2|\},$ we then have $K\ge K_1,$ so that $f(x)\le K$ for all $x,$ and we also have $-K\le K_2,$ so that $f(x)\ge-K$ for all $x.$ Hence, $-K\le f(x)\le K$ for all $x,$ and so $|f(x)|\le K$ for all $x.$

