If you are looking at the limit of piecewise function at the point where the function changes its formula, then you will have to take one-sided limits separately since different formulas will apply that depending on which side you are approaching from.
For example:
The following piecewise-defined function:
[tex]f(x)=\begin{cases}x^2\text{ if x<1} \\ x\text{ if 1}\leq x\leq2 \\ 2x-1\text{ if 2 }\leq x\end{cases}[/tex]Then,
Lets find the following limits:
[tex]\begin{gathered} (a)\lim _{x\rightarrow1^-}f(x)=\lim _{x\rightarrow1}x^2=(1)^2=1 \\ \lim _{x\rightarrow1^+}f(x)=\lim _{x\rightarrow1^+}x^2=(1)^2=1 \end{gathered}[/tex]Then,
[tex]\begin{gathered} (b)\lim _{x\rightarrow2^-}f(x)=\lim _{x\rightarrow2^-}x^{}=(2)^{}=2 \\ \lim _{x\rightarrow2^+}f(x)=\lim _{x\rightarrow2^+}x^{}=(2x-1)^{}=2(2)-1=3 \end{gathered}[/tex]Since, the limits above are different, limit that not exists.
The limit is:
[tex]\lim _{x\rightarrow2}f(x)[/tex]