$$f(x)= \begin{cases} x ; x\le 1 \\ 5;x \gt 1 \end{cases}$$
For example, if I have to check the continuity at $x=0$, I'd simply do,
$$f(0)=0$$
also,$$\lim_{x \to 0}x=0=f(0)$$
Hence, $f$ is continuous at $x=0$.
But the solution manual does something like,
putting $x=x-h$ as $x \to 0^-, h \to 0$
$$\lim_{h \to 0}(0-h)=0$$
and putting $x=x+h$ as $x\to 0^+$ , $h\to 0$
$$\lim_{h\to 0}(0+h)=0$$
Hence, L.H.L.=R.H.L.=$f(0)$ $f$ is continuous at $x=0$.
I think doing all this was rather unnecessary. You don't even need to find the L.H.L. and R.H.L. separately for this case ($x=0$). Or do I? I think I'd only be required to do so if I had to check the continuity at $x=1$, and even in that case I would not assume $x=x-h$ or $x=x+h$, I would have calculated the limit directly.
My question being, is assuming $x=x-h$ or $x=x+h$ for finding one sided limits, as done above, necessary or is it just trivial? Also are there any cases in which the assumption is useful or necessary?