Analyzing if function is "onto" I have some function $g$. I know that $g \in C^1[a,b]$, so $g'(x)$ exists. I want to know, if $g: [a,b] \to [a,b]$ is onto. How can I find out if this is true or not?
P.S. I am not saying all $g$ have the said property, I want to have some kind of test to distinguish functions with this property from functions without it.
 A: Not sure this is the type of criterion you're seeking, but if $g:[a, b] \to [a, b]$ is continuously-differentiable (continuous in particular), then by the Intermediate Value Theorem, $g$ is surjective if and only if $g$ achieves the values $a$ and $b$, i.e., there exist numbers $x_{\min}$ and $x_{\max}$ in $[a, b]$ such that $g(x_{\min}) = a$ and $g(x_{\max}) = b$. By elementary calculus, such points must be endpoints of the domain, or critical points of $g$ (i.e., solutions of $g'(x) = 0$).
Procedurally, evaluate $g(a)$ and $g(b)$; if necessary, find all solutions of $g'(x) = 0$ (there may be infinitely many, of course...) and for each, evaluate $g(x)$. Your function is surjective if and only if the numbers $a$ and $b$ occur among these function values.
A: We provide a class of functions $g\in C^1[a,b]$ such that $g(x)\in [a,b]$ for all $x\in[a,b]$.
(1) $g(a), g(b)\in[a,b]$;
(2) $|g^\prime(x)|\leq \alpha \; \forall x\in (a,b)$, where
$$
\alpha\leq\min\left\{\frac{b-g(a)}{b-a};\frac{g(b)-a}{b-a}\right\}.
$$
Indeed, if $x\in [a, b]$ then there exists $\xi_1, \xi_2\in(a,b)$ such that
$$
|g(x)-g(a)|=|g^\prime(\xi_1)(x-a)|\leq \alpha(b-a),
$$
$$
|g(b)-g(x)|=|g^\prime(\xi_2)(b-x)|\leq \alpha(b-a).
$$
It follows that
$$
g(x)\leq\alpha(b-a)+g(a)\leq b-g(a)+g(a)=b,
$$
$$
g(x)\geq g(b)-\alpha(b-a)\geq g(b)-[g(b)-a]=a.
$$
Therefore, $g(x)\in [a,b]$ for all $x\in[a,b]$.
Example We can choose $g(x)=\frac{1}{2}x^2\in C^1[0,1]$. We have
(1) $g(0)=0\in[0,1], g(1)=1/2\in[0,1]$;
(2) We have
$$
\alpha:=\min\left\{\frac{1-g(0)}{1-0};\frac{g(1)-0}{1-0}\right\}=1,
$$
and
$$
|g^\prime(x)|=|x|\leq \alpha\quad \forall x\in(0,1).
$$
A: Well, given any $g\in C[a,b],$ we have that $g$ maps $[a,b]$ onto itself if and only if $g(x_1)=a$ for some $x_1\in[a,b],$ $g(x_2)=b$ for some $x_2\in[a,b],$ and $g(x)\in[a,b]$ for all $x\in[a,b].$ Put another way, we have $$\{a,b\}\subseteq g\bigl([a,b]\bigr)\subset[a,b],$$ where $g\bigl([a,b]\bigr)$ denotes the image of $[a,b]$ under $g.$
Obviously, if $a$ or $b$ fails to be mapped to by $g$, then $g$ doesn't map $[a,b]$ onto itself, and if there is some $x\in[a,b]$ such that $g(x)\notin[a,b],$ then we don't even have $g:[a,b]\to,[a,b].$ However, if all three conditions hold, the Intermediate Value Theorem tells us that $(a,b)\subseteq g\bigl([a,b]\bigr),$ whence we have $$[a,b]\subseteq g\bigl([a,b]\bigr)\subseteq[a,b],$$ and so $g\bigl([a,b]\bigr)=[a,b],$ as desired.
The same arguments work in $C^1[a,b],$ as a subset of $C[a,b].$
