For the function: $$f(x) = \begin{cases}0 & ~~\text {if}~~ x=-1;\\ -x & ~~\text{if}~~ -1 \lt x \lt 0;\\ x & ~~\text{if } 0 \le x\le 1 \end{cases}$$ $$f(x+2) = f(x) + 1$$ make this graph, and watch the graph.
I'm sure that $y=f(x)$ is discontinuous at $x=1$, but about $x \in [0,1]$, $x$ is continuous at $x=1$ ?