A function g:R-->R that is not onto and not 1-1

cos(x) is a function g:R->R so that f is not onto and f is not 1-1.

> g:=unapply(cos(x),x);

[Maple Math]

> plot(g(x),x=-10..10);

We know from calculus that cos x is a function. But, it is not so easy to rigorously prove - t ry it without assuming what you are trying to prove ! Let's assume that we have proved that cos x is a function.

To prove that cos x is not 1-1 we must produce x1 not equal to x2 so that cos(x1)=cos(x2).

Take x1=Pi and x2=3Pi. Notice that x1 and x2 are real and unequal. Also,

> cos(Pi);

[Maple Math]

> cos(3*Pi);

[Maple Math]

and so cos(x1)=cos(x2). Hence cosx is not 1-1.

To prove that cos x is not onto we must produce y so that cos(x) is not equal to y for all x in R.

Take y=2. Assume for contradiction that cos(x)=2 for some x in R.

> evalf(solve(cos(x)=2,x));

[Maple Math]

Then x=1.316957897 I. We have arrived at a contradiction to the fact that x is in R, since x is complex.

Hence, cos(x) is not equal to 2 for all x in R, and so cos x is not onto.