So I made up the following function as a thought exercise (for myself).
$$f(x) = 1\hspace{0.3cm} \forall\hspace{0.1cm} x = 1,2,3 \hspace{0.4cm}\text{and} \hspace{0.4cm} -1 \hspace{0.3cm}\forall \hspace{0.1cm}x = 4,5,6.$$
I have already proven that this function is not continuous.
But how would I go about proving (or disproving—honestly I have no idea) that the following limit exists:
$$\lim_{x\to 3}f(x)= ?$$
For $x\to 3^-$, f(x) is not defined.
Similarly, For $x\to 3^+$, f(x) is not defined.
But, at $x=3$, $f(x)=1$
For limit to exist at $x=3$, function must attain a value (same value) at $x\to3^-$ and $x\to 3^+$, which may be different from value of function at 3.
For eg., consider $$\lim_{x\to3^-}=\lim_{x\to3^+}=p$$ And, $$f(3)=q$$
So, Limit exists at $x\to3$ and its value is p. $$\lim_{x\to3}=p$$
edit:
Also, there are cases where a function is not defined for one side, in such cases, we go for one-sided limit.
For eg. Consider $$f(x)=\sqrt x$$ f(x) is not defined for $x\to 0^-$
So, $$\lim_{x\to 0}=f(0^+)=0$$ i.e., limit is equal to value of f(x) for $x\to 0^+$.