Intermediate value theorem for $\sin x.$ How is intermediate value theorem valid for $\sin x$ in  $[0,\pi]$?
It has max value $1$ in the interval $[0,\pi]$ which doesn't lie between values given by $\sin0$ and $\sin\pi$.
 A: Let $f\colon[a,b]\longrightarrow\mathbb R$ be a continuous function and let $y\in\mathbb R$. The intermediate value theorem  says that if $f(a)\geqslant y\geqslant f(b)$ or if $f(a)\leqslant y\leqslant f(b)$, then there is a $c\in[a,b]$ such that $f(c)=y$. But it says nothing if $y$ lies outside the interval bounded by $f(a)$ and $f(b)$. So, there is no contradiction here.
A: That's not how it works. The Intermediate Value Theorem says that if $f$ is continuous on $[a,b]$, then it achieves every value between $$c=\min\{f(x):\ x\in [a,b]\},$$ and $$d=\max\{f(x):\ x\in [a,b]\}.$$ 
When $f$ is monotone, it happens that $c,d$ are $f(a),f(b)$, but in general it is not the case. 
A: Intermediate Value Theorem says that 

Let $f$ be a function, continuous on the interval, $[a, b]$. Then $f$ takes any value between $f(a)$ and $f(b)$ at some point within the interval.

In your case, $\sin x$ is 0 at both $x=0$ and $x=\pi$, and the IVT implies there is a point $y\in[a,b]$ such that $\sin y = 0$. You can let $y=0$ or $y=\pi$...
UPDATE
Note this does not mean $f$ must always be between $f(a)$ and $f(b)$, just that every value between $f(a)$ and $f(b)$ is covered.

A: In general, any time you have a theorem, "If ____, then ____," it really means, "If ____, then ____ and maybe some other stuff not mentioned here also happens."
Because when you're working in just about any branch of mathematics,
no matter how thoroughly you describe the implications of any mathematical fact there is always some other possible case you could have said something about but didn't.
The only things you can rule out are the things the theorem explicitly says cannot happen.
Unless a theorem says "and there are no other values outside this interval,"
don't assume all the values are inside the interval.
In your example, the value $\sin(\pi/2)=1$ is part of the "other stuff"
that "also happens."
