continuity of a piece wise function defined partially on a closed interval

60 Views Asked by At

using epsilon delta definition prove that $f(x)=\left \{ \begin{array}{cc} 2 & : x \in[0,1]\\ 1 & : x=-1 \end{array}\right.$ is continuous on $E= [0,1] \cup \{-1\}$.

Here is my attempt. I want to show first that f is continuous at -1 and then show that it is continuous at every point of $[0,1]$. f is cont at -1 if $\forall \epsilon > 0$, I want to find a $\delta>0$ such that for all $x \in E$, $|x+1| < \delta \Rightarrow |f(x)-f(-1)| < \epsilon$. If i choose $\delta = \frac{1}{2}$, we have that $\frac{-3}{2}<x<\frac{-1}{2}$ and the only $x$ I have in EE that satifies the property is $x=-1 \Rightarrow |f(x)-f(-1)|=0 < \epsilon$. Hence f is cont at $-1$.

Secondly, f is continuous on the interval $[0,1]$ if and only if f is continuous at a point $x_0 \in [0,1]$. fix $x_0 \in [0,1]$, then for any given $\epsilon >0$ I want to find a $\delta >0$ such that for all $x \in E, |x-x_0| < \delta \Rightarrow |f(x)-f(x_0)| < \epsilon$. My problem is I cant seem to find an appropriate $\delta$ that works for me. please guys help me. Thanks