I am a beginner. Per professor's instruction, all steps must be written explicitly. If you spot a mistake be sure to note it?
Question: Determine whether $f(x)=\cos(x)$, for $f:\mathbb{R}\to[-1,1]$, is onto $[-1,1]$ or one-to-one?
If $f$ is onto, we prove for $y\in[-1,1]$ there exists an $x\in \mathbb{R}$ such that $y\in\text{Rng}(f)$. Therefore, we find an $x$ by taking $y=\cos(x)\Rightarrow \cos^{-1}(y)=\cos^{-1}(\cos(x))\Rightarrow \cos^{-1}(y)=x$. Hence, $x\in[-\pi,\pi]\subseteq\mathbb{R}$. Next, we substitute $x$ into $f(x)$: $f(x)=f(\cos^{-1}(y))=\cos(\cos^{-1}(y))$. Therefore, $y\in\text{Rng}(f)$. Thereby, $[-1,1]\subseteq\text{Rng}(f)$. Therefore, $[-1,1]=\text{Rng}(f)$. By definition of a surjective function, $f$ is onto $[-1,1]$.
Now suppose $f$ is one-to-one. If $f(x)=f(y)$ then $x=y$. But if $f(x)=f(y)=1$ then $x=2n\pi$ and $y=2m\pi$ for $m,n\in\mathbb{N}$. If $m\neq n$, then $x\neq y$. This contradicts our hypothesis that $f$ is one-to-one. Therefore, $f$ is not one-to-one.
You are over-complicating things.
$\cos:\mathbb{R}\to[-1,1]$ is not injective but it is surjective.
To show that it is surjective, use the intermediate value theorem. You know that $\cos(\pi)=-1$ and $\cos(0)=1$, so by the intermediate value theorem, for any $y\in[-1,1]$, there is an $x\in[0,\pi]$ with $\cos(x)=y$. Since $|\cos(x)|\leq 1$, then it is surjective onto $[-1,1]$.
To show that it is not injective, use the fact that $\cos$ is an even function, i.e., $\cos(x)=\cos(-x)$.