Continuous Function on a closed interval $[a,b]$ A continuous function on a closed interval $[a,b]$ is bounded and attains its bounds.
A continuous function on $(a,b]$, $[a,b)$, or $(a,b)$ may not be bounded at all or attain its bounds, this fact can be demonstrated by counterexamples.
Since the latter three intervals are subsets of $[a,b]$, IF we already knew however that $f(x)$ is continuous  on $[a,b]$, does the following have to be true? 

$f(x)$ is bounded on $(a,b]$, $[a,b)$, or $(a,b)$. However, it may not attain its bounds since $f$ may have attained them at the endpoints.

 A: If $f$ is continuous on $[a,b]$, then for all $x\in[a,b]$,
$$L\leq f(x)\leq M$$
for some $L,M\in\mathbb{R}$. So, if $x\in (a,b)$ (or $[a,b)$ or $(a,b]$), then $x\in [a,b]$ also, and we must have $L\leq f(x)\leq M$ again. 
Edit: I think I understand now. For example, $-1 \leq \sin(x)\leq 1$ for 
$$x\in[-\pi/2,\pi/2]$$
as well as:
$$x\in [-\pi/2,\pi/2),\quad (-\pi/2,\pi/2],\quad (-\pi/2,\pi/2)$$
but $\sin(x)$ does not attain $1$, $-1$, or both anywhere in the three intervals: 
$$[-\pi/2,\pi/2),\quad (-\pi/2,\pi/2],\quad (-\pi/2,\pi/2)$$ 
respectively. So $\sin(x)$ does not attain both of its bounds on the three intervals above, because it attains them at the endpoints.
A: If $f$ is continuous on $[a,b]$, then $f$ may or may not attain its minimum and maximum values on $(a,b)$, $[a,b)$ and $(a,b]$.
Example1: $f(x)= \sin x$ on $( 0 , 4\pi )$ attains both maximum and minimum values.
Example2: $f(x)= x^2$ on $(-1,1)$ attains minimum but not maximum.
Example3: $f(x)=x$ on $(0,1)$ attains neither maximum nor minimum.
