Consider $f: (0, 2] \to [-5, 7]$ defined as $f(x) = \begin{cases} x & 0 < x\leq 1 \\ 1 & 1 < x \leq 2 \end{cases}$
Is this function well defined? Is it continuous?
Attempts
I believe $f$ is well defined, since the domain is well specified and the codomain is $[-5, 7]$. It suffices that $x \in [-5, 7]$ then. Is that enough?
For the continuity part, it's not specified but I think it was understood "at $x = 1$".I tried to used the definition the professor gave us, but I don't know if it's correct:
$$|f(x) - f(1)| = |x-1| \to 0\ \text{as}\ x\to 1$$
It looks too easy, so it will be surely wrong.
I did not use the right-left limits, because I wanted to avoid this technique.