Extreme Value Theorem Proof (Spivak) 
Them: If $f$ is continuous on $[a,b]$, then there is a $y$ in $[a,b]$ such that $f(y) \geq f(x)$ for each $x \in [a,b]$
Proof. We already know that $f$ is bounded on $[a,b]$, which means that the set $$\{ f(x):x\text{ in }[a,b]\}$$ is bounded. This set is obviously not $\varnothing$, so it has a least upper bound $\alpha$. Since $\alpha\geqslant f(x)$ for $x$ in $[a,b]$ it suffices to show that $\alpha=f(y)$ for some $y$ in $[a,b]$.
Suppose instead that $\alpha\neq f(y)$ for all $y$in $[a,b]$. Then the function $g$ defined by $$g(x)=\dfrac1{\alpha-f(x)},\quad x\text{ in }[a,b]$$ is continuous on $[a,b]$, since the denominator of the right side is never $0$. On the other hand, $\alpha$ is the least upper bound of $\{f(x):x\text{ in }[a,b]\}$; this means that $$\text{for every $\epsilon\gt0$ there is $x$ in $[a,b]$ with $\alpha-f(x)\lt\epsilon$}.$$ This, in turn, means that $$\text{for every $\epsilon\gt0$ there is $x$ in $[a,b]$ with $g(x)\gt1/\epsilon$}.$$ But this means that $g$ is not bounded on $[a,b]$, contradicting the previous theorem. $\Rule{0.3em}{0.87em}{0.1em}$

OKay first of all how on earth does one come up with $g(x)$? It just feels like it comes out of nowhere. On the other hand what does

This means that: for every $\epsilon > 0$, there is x in $[a,b]$ with $\alpha - f(x) < \epsilon$

even mean? This statement is true, I agree, but I have absolutely no feeling for it. I also do not understand the last line with $g$. He could have chosen $\epsilon  = \alpha - f(x)$ and be done it no?
 A: Where did $g$ come from?
The author needed a function that would be continuous on $[a, b]$ if $\alpha$ was not a value of $f(x), x\in[a, b]$.  Basically, he chose this function because it is easy to see that it becomes discontinuous only if the least upper bound for the set is also in the set.
He needed it to become discontinuous to provide the contradiction found in the last step.
What does that quoted statement mean?

$$\text{for every }\varepsilon > 0\text{, there is } x \in [a,b]\text{ with }\alpha−f(x)<\varepsilon$$

In non-math talk, this basically means that, if you pick as small an $\varepsilon$ as you want, then there is an $x$ value in the range such that $\alpha - f(x)$ is less that that value you picked.
Even further in non-math talk: Pick any small value, and the function gets closer to the least upper bound than the magnitude of that small value.
(I know this is somewhat late, but I drafted it before leaving for a meeting... I didn't want it to go to waste. ;))
A: The sort of trick involved with the $g$ here is actually very common in mathematics. It's hard to describe to you since you're still working through Spivak, but when you get to things like real and complex analysis you'll see that this sort of argument is completely standard (which is how Spivak managed to come up with it).
It's a matter of experience, that's all. Learn to use this trick, it will come in handy many times.
For the last line, replace $1/\varepsilon$ by $M$. Then what Spivak is saying is that for every $M>0$, no matter how large, there exists $x \in [a,b]$ such that $g(x)>M$, i.e. $g$ is unbounded. You get the "no matter how large" by choosing $\varepsilon$ very small.
A: This proof is a little weird. On a slightly more abstract, but clearer imo, level what is going on here with this theorem is that continuous maps (in general) take compact sets to compact sets; i.e. $f([a,b])$ is closed and bounded for the case of $\mathbb{R}^n$. So the maximum of $f$ is attained. 
This proof is doing things in a little bit more rudimentary way, by just using that there is a cauchy sequence converging to the maximum in the image of $f$, and using apriori knowledge that continuous maps on closed, bounded sets are bounded. 
Edit: Apparently the above dosen't answer the question: To spell things out even more explicitly, we are assuming the function $g$ is continuous, so it is bounded, and then arriving at a contradiction.
