Extreme value theorem proof 
Let $f:\mathbb{R}\to\mathbb{R}$ and $$f(x)=x^2-\cos(x)$$
Prove using the definitions that $f$ achieves a minimum value.

So since $f$ is continuous by defintion it has has a minima and maxima on a closed interval.
Also we can see that $\displaystyle\lim_{x\to\pm \infty} f(x) = \infty$.
Therefore by the definition of limits we have that $\forall M$ $\exists K$ s.t. when $x > K$ we have that $f(x) > M$.
Let $M = 1$. Now by the Extreme value theorem there exists an $c \in [-K, K]$ s.t. $f(c) < f(x)$.
Since $M=1$ and by definition we have that $f(x) > M$
we can conclude that $f(c) < M < f(x)$.
Therefore $f(c) < f(x)$ $\forall x \in \mathbb{R}.$
Is this proof valid? My concern is the last part where I state that $f(c)<M.$ I'm not sure is this true? Any comments would be appreciated.
 A: Your proof is basically correct, although a little confusing. I'd argue it as follows:
Consider $f(0)=1$. Note that when $|x|>2$, $|f(x)|>|x^2|-1>2^2-1=3$. So, the minimum of the function on the range $[-2,2]$ is the minimum of the function as a whole. Then, your argument proceeds from here.
A: Your proof has the big idea of "choose a minimum from an interval where $f$ is definitely small", but it is not fully correct in its use of the fact.
The start of the proof is good: let's take some $K$ such that if $|x| > K$ then $f(x) > 1$. However, then you start to lose all quantifiers from your proof and things go wrong. The next step you suggest is to pick some $c\in [-K,K]$ minimizing $x$ over that interval. That means that 
$$f(c) \leq f(x)$$
for all $x\in [-K, K]$. At this stage recall your goal: You want to show that $f(c) \leq f(x)$ for all $x$. Note too that your argument, as is common in analysis, divides into two cases: "small" $x$ in $[-K,K]$ and "big" $x$ which are not - and it is vitally important to make this distinction clear in your proof writing, and I think the failure of your proof to do so is likely the cause of its flaw.
Okay, so you already know your goal whenever $x\in [-K,K]$. Sensibly, you move on to handling those $x$ that are not in $[-K,K]$ and you state the one thing you know:
$$1 < f(x)$$
for all $x$ not in $[-K,K]$. Then you miss a step: we need to show that $f(c)\leq 1$ in order to imply that $f(c) \leq f(x)$ for $x$ not in $[-K,K]$ by transitivity - but you offer no argument to prove that, oh no!
Note that this is not just a stylistic critique: something really could go wrong at this step. What if we had been handed $f(x) = 17 + (x - 10)^2$? That function clearly obtains its minimum at $x=10$ - and, if we follow your argument, we see that it's fair enough to say that $f(x) > 1$ if $|x| > 1$. Okay, so we then minimize $f$ on $[-1,1]$ and see that $f(1)$ is the minimum on that interval - but $f(1) = 98$ and isn't the minimum, so our argument failed! We didn't find the minimum. The trouble is that $1$ is a terrible choice of lower bound - the function never gets that small, so saying $f(x) > 1$ is a completely useless statement - but the function in your question, of course, is different: it really does obtain small values; for instance, $f(0) = -1$. Let's use this. 
Remember that $f(c) \leq f(x)$ for any $x \in [-K,K]$. Well, we know that $f(0)=-1$ and $0\in [-K,K]$ irrespective of what $K$ is. So $f(c) \leq f(0) = -1$ by definition. Then we can see that for any $x$ not in $[-K, K]$ we would have $f(c) \leq -1 < 1 < f(x)$ - and thus we are done.
A: Your proof is essentially correct.
I think you could make it clearer by quantifying the variables in all your formulas. For example, "$f(x) > M$" is more clear as "$f(x) > M$ for all $x\in S$" (for the appropriate set $S$). This could help in a couple places. In particular, this will help where you wrote "by the extreme value theorem there exists $c\in[-K,K]$ s.t. $f(c) < f(x)$." I think what you really meant here is "$f(c) < f(x)$ for all $x\in [-K,K]$."
You chose the number $K$ so that $x\in[-K,K] \implies f(x)<M$. Since $c$ was chosen from $[-K,K]$, that is your proof that $f(c)<f(M)$.
