Let's say I have a function that looks something like this. $$ f(x) = \begin{cases} x & x\leq 0 \\ 1 & x=1 \\ x & x\ge 2 \end{cases} $$ What would the values of $$\lim_{x\to1^-} f(x)$$ and $$\lim_{x\to1^+} f(x)$$ be? My guess is that it should be $0$ and $2$, respectively because we can ignore the regions $(0, 1)$ and $(1, 2)$ since the function isn't defined there.
Also, is the function continuous at $x = 1$?
What if I change the function to $$ f(x) = \begin{cases} 1 & x\leq 0 \\ 1 & x=1 \\ 1 & x\ge 2 \end{cases} $$ ? What would the limits be now? Would this new function be continuous?
Apologies if a similar question has been asked before. I didn't find anything relevant based on my searches.
My definition of limit is this: $$\forall\epsilon>0\ \exists\delta>0\ \forall x\in dom(f)\ (0 < |x - a| <\delta \implies |f(x) - l| < \epsilon)$$ So for the second case, if $l = 1$, for every $\epsilon\gt0$, we can choose $ = 2$, and we'll have $(0<|−|< ⟹ |()−|<)$. So limit at $1$ should be $1$. Is there a flaw in my understanding?