proof Intermediate Value Theorem Intermediate Value Theorem
The idea of the proof is to look for the first point at which the graph of f crosses the axis.
Let X = {x ∈ [a, b] | f (y) ≤ 0 for all y ∈ [a, x]}. Then X is non-empty since a ∈ X and X ⊆ [a, b] so it is bounded. Hence by the Completeness Axiom, X has a least upper bound α (say).
We claim that f (α) = 0.
how can be written it formal?
 A: The quick way to do this is to use the fact that the connected subsets of $\mathbb R$ are intervals.
Wlog $f(a)<f(b)$ and suppose there is a $c\in [f(a),f(b)]$ such that $x\in [a,b]\Rightarrow f(x)\neq c.$ Now, $f([a,b])$ is connected, hence an interval. Therefore, either $f([a,b])\subseteq [c,\infty )$ or $f([a,b])\subseteq (-\infty,c]. $ But either way, we get a contradiction because $f(a)\notin [c,\infty )$ and $f(b)\notin (-\infty,c ].$
A: First of all note that the ideas in your question constitute almost 99% of the proof and handle the most difficult parts of the proof. And the remaining part of the proof is obtained by getting contradictions for assumptions $f(c) > v$ and $f(c) < v$ forcing us to conclude that $f(c) = v$. The contradiction follows from the following local property of continuous functions (it also goes by the name of sign preserving property):
If $f$ is continuous at $a$ and $f(a) \neq 0$ there is a neighborhood of $a$ in which $f$ maintains the same sign as that of $f(a)$.
This is an important but easy consequence of definition of continuity and I hope you can prove this by yourself.
Now consider your question and assume that $f(c) > v$. Then using the above sign preserving property we can prove that there is a neighborhood $I$ of $c$ such that all values of $f$ in $I$ are greater than $v$. Since $x_{n} \leq c \leq y_{n}$ and $$\lim_{n \to \infty}x_{n} = \lim_{n \to \infty}y_{n} = c$$ it follows that there is a value of $n$ for which $[x_{n}, y_{n}] \subseteq I$ and since $f(y_{n}) \leq v$ gives us a contradiction (as $y_{n} \in I$ and hence $f(y_{n}) > v$).
Update: The question has changed and the given answer corresponds to original version where it is asked to establish intermediate value theorem via the use of the Nested interval principle.
A: Suppose f is continuous on I=[a,b].
Suppose $ \exists k \in (f(a),f(b))$ so that $f(c) \not = k \ \forall c \in (a,b)$, we'll derive a contradiction. 
Let $U$ be an open set whose boundary contains $k$, keep in mind we can restrict $U$ to be small enough so that $f$ is monotone on $U$ (Define neighbourhoods with epsilons or deltas if you wish)  
If $U \cap f(I)^c \not= \emptyset $ for any $U$, then there's a set $S \subset (f(a),f(b))$ with non empty interior and $f^{-1}(S) = \emptyset$
This would imply a jump discontinuity in the function, so we can choose $U$ to be contained in $f(I)$. 
Now just find a sequence $y_n \in U$ converging to $k$, this gives a sequence $x_n \in f^{-1}(U)$ converging to some $c \in bd(f^{-1}(U))$ by definition of the preimage, ($f(x_n) = y_n$)
Of course $f^{-1}(U)$ is contained in $[a,b]$ so $f$ is continuous on its closure.
Furthermore its closure is compact so the image of $cl(f^{-1}(U))$is compact, and it contains $k$. 
Taking limits as $n \to \infty$ we get $y_n \to k \implies x_n \to c$ with $f(c) = k$ by Squeeze. 
$c \in cl(f^{-1}(U)) \implies c \in (a,b)$, our contradiction $_{\Box}$
