We have,
f: R → R, f(x) = cos x
Now,
f (x1) = f (x2)
cos x1 = cos x2
x1 = 2nπ ± x2, n ∈ Z
It’s seen that the above equation has infinite solutions for x1 and x2
Hence, f(x) is many one function.
Also the range of cos x is [-1, 1], which is subset of given co-domain R.
Therefore, the given function is not onto.