How can I find if a function reaches its maximum values?
For example, for the function $f: (-1, 1) \to \mathbb R, f(x) = \ln\frac{1-x}{1+x}$
To reach its maximum values, there should be an $x_0\in (-1, 1)$ so that $f(x_0) = \inf A = -1$ and an $x_1 \in (-1, 1)$ so that $f(x_1) = \sup A = 1$.
And for the function $ f : [0, 1]\to \mathbb R$, $f(x) = x$ if $x ∈ (0,1] $ and $ f(x) = \frac{1}{2} $ if $ x = 0$
To reach its maximum values, there should be an $x_0 \in [0, 1] $ so that $f(x_0) = \inf A = 0 $ and an $x_1 \in [0,1]$ so that $f(x_1) = \sup A = 1$.
I thought about proving that the first function is continuous, but I can't do the same thing for the second function.
For the first one : $$f(x)= \ln\left(\frac{1-x}{1+x} \right) = \ln \left(\frac{2}{x+1}-1\right)$$
so $f$ is strictly decreasing. Because its domain is the open interval $(-1,1)$, then $f$ cannot attain its bounds (neither its $\sup$, nor its $\inf$).
For the second one, you can see that for all $x \in [0,1]$, $f(x) \leq 1$, and $f(1)=1$, so $f$ attains its $\sup$. But $f$ does not attains its $\inf$ : indeed, $f(x) \geq 0$ for all $x$, and $\lim_{x \rightarrow 0 \\ x > 0} f(x) = 0$, so $\inf f = 0$, but $0$ is not in the image of $f$.