Help with proof that that $f(x)=\cos x\,\,\,[0,\pi]\rightarrow[-1,1] $ is one to one and onto Is there a way to prove that $f\,:\,[0,\pi]\rightarrow[-1,1]\,\,\,\,f(x)=\cos x$ is one to one and onto ? 
I know that for $[0,\pi]$ cosine is strictly increasing function therefore it has to be one to one (I understand that graphically) However I can not prove it. 
Second thing - How do I prove that a function is onto ? what is the general technique and what is the way to prove it for cosine.? 
 A: On $[0,\pi]$, the cosine function is strictly decreasing. You can see this by looking at its derivative $-\sin x$  and noting that $\sin x>0$ on $[0,\pi]$. This proves the one-to-oneness since $\cos(0)=1>-1=\cos(\pi)$.
For onto, you can use the Intermediate Value Theorem: Since $\cos$ is continuous on $[0,\pi]$, it must assume all values in between $\cos(0)=1$ and $\cos(\pi)=-1$.
A: You will need the proof that the function is strictly decreasing to prove that it is onto.  The general technique would be to argue that for all $y$ in the image of the function, there is an $x$ in the domain such that $f(x) = y$.
In this case, proving it is onto can be reduced to using the intermediate value theorem once you can prove that the function is strictly decreasing.  By the IVT, if $f(a) = y_1$ and $f(b) = y_2$, and $y_3 \in [y_1,y_2]$ then there must exist $c \in [a,b]$ such that $f(c) = y_3$.  In your case, $f(0) = 1$ and $f(\pi) = -1$, so there $\forall y \in [-1,1] \exists x\in[0,\pi] s.t. f(x) = y$, and the function is onto.
