If $x \leq g(x) \leq x^2-x+1$ where $x \in [0,2]$, can we say that $g(x)$ is continuous at $x=1$? If $x \leq g(x) \leq x^2-x+1$ where $x \in [0,2]$, can we say that $g(x)$ continuous at $x=1$ ?
Is $g(x)$ continuous in $[0,2]$?
 A: Hint: For the first part, you know that your function can't be "further away" from 1 than either of the bounding functions are. For the second part, you should be able to just draw a counterexample. Start by sketching the two bounding functions.
A: If $I$ is an intervall and $f,h\colon I\to\mathbb R$ are continuous functions with $f(x)\le h(x)$ for all $x\in I$. Then


*

*If $f(a)=h(a)$ for some $a\in I$, then any function $g\colon I\to\mathbb R$ with $f(x)\le g(x)\le h(x)$ for all $x\in I$ is continuous at $a$.

*If $f(a)\ne h(a)$, there exists $g\colon I\to \mathbb R$ with $f(x)\le g(x)\le h(x)$ for all $x\in I$ that is not continuous at $a$.


For the first part note that for given $\epsilon>0$ there are $\delta_f,\delta_h>0$ such that for $x\in I$ with $|x-a|<\delta_f$ we have $|f(x)-f(a)|\le \epsilon$ and if $|x-a|<\delta_h$ then $|h(x)-h(a)|<\epsilon$.
Conclude that with $\delta:=\min\{\delta_f,\delta_h\}$ we have $|g(x)-g(a)|\le\epsilon$ if $|x-a|<\delta$.
For the second part, consider $g(x)=\begin{cases}f(x)&\text{if }x\in\mathbb Q,\\h(x)&\text{if }x\notin \mathbb Q.\end{cases} $
A: For the second one: Assume there is a continues $g(x)$ in $[0,2]$
that satisfy $${x\leq g(x)\leq x^{2}-x+1}$$ note that this
imply $$0.5\leq g(0.5)\leq0.25-0.5+1=0.75$$
Consider $\widehat{g}:[0,2]\to\mathbb{R}$ s.t $\widehat{g}(x)=g(x)$
for all $x\neq0.5$ and such that $$\widehat{g}(0.5)=g(x)+\delta$$
where $\delta\neq0$ is some number such that the above inequality
holds.
Then $\widehat{g}$ satisfy the above inequality but is not continues 
