How do I use the intermediate value theorem to prove that $x=\cos x$ has a solution? I'm taking differential calculus, and I've read that is actually a pretty interesting function that just has one solution. I'm a little confused since most proofs that involve the Intermediate value theorem give a closed interval. But I need to prove that it has a solution in the real numbers. Thanks in advance.
 A: HINT:
Let $f(x)=x-\cos(x)$.  
Note that $f$ is continuous  for $x\in[0,\pi/2]$ with $f(0)=-1$ and $f(\pi/2)=\pi/2$.  
Given the Intermediate Value Theorem, what can one say about $f$ on the closed interval $[0,\pi/2]$, which is a subset of the real numbers?
A: I think I misread your question initially. It seems you're asking something like "I've seen proofs that there's a solution on a closed interval using the Intermediate Value Theorem, but how do you prove there's a solution in the reals?"
If that's your question, the answer is that a closed interval is contained within the reals (as a subset), so a solution "on a closed interval" is a solution in the real numbers.
A: If you can find a suitable closed interval within which there is a solution, then there is a solution somewhere in the real line because the closed interval is a subset of the real line.
A: Let the function 
$f \colon \mathbb{R} \to \mathbb{R}$ be defined by 
$$f(x) = x - \cos x \ \mbox{ for all } x \in \mathbb{R}.$$
Then we note that $$ f^\prime (x) = 1 + \sin x \geq 0 \ \mbox{ for all } x \in \mathbb{R}. $$
So $f$ is a non-decreasing function on every (finite) interval on the real line, and $f$ is a strictly increasing function on every finite interval on the real line which does not include the points $\frac{3\pi}{2} + 2n \pi$ for $n\in \mathbb{Z}$ as its interior points. 
Moreover, we see that $$ f(0) = -1 \ \mbox{ and } \ f\left( \frac{\pi}{2} \right) = \frac{\pi}{2}.$$
So if $x$, $y$, and $z$ are any three real numbers such that $$x < 0 < y < \frac{\pi}{2} < z,$$ then we must have 
$$ f(x) < f(0) = -1 < f(y)  <  f\left( \frac{\pi}{2} \right) = \frac{\pi}{2} <  f(z).$$
Finally, as $f$ is continuous everywhere on the real line, so we can assume that there is exactly one real number $p$ such that $f(p)=0$; in fact that real number $p$ is strictly between $0$ and $\pi/2$. 
