The theorem says that:
Suppose that $f$ is continuous on $[a,b]$, $f(a)\ne f(b)$ and $f(a) < k < f(b)$ then there exists at least one point $c\in (a,b)$ such that $f(c)=k$.
A textbook I've been following does the proof using sequences. The authors define the set $S=\{ x\in [a,b] : f(x) <k \}$ and they let $c=\sup S$ and claim that $f(c)=k$ and then complete the proof by proving that $f(c) \le k$ and $f(c) \ge k$.
Everything seems legit. But I was wondering if I could prove this claimed c can neither be $a$ and $b$. Now if $c=a$, then for every $n \in \mathbb{N}$, there is $x_n \in T$ such that $a-\frac{1}{n} < x_n \le a$. Now if $x_n < a$ then $x_n \not\in [a,b]$ and thus $x_n \not \in T$. Thus it must be that $x_n = a$ for every $n \in \mathbb{N}$. By the continuity of $f$ at $a$, we have $f(c) = \lim f(x_n) = f(a) < k$. This breaks down the proof done by the authors. However, this doesn't show that this claimed $c$ doesn't equal either $a$ or $b$. Can I get some hints here?