In order for the limit to exist we need both one-sided limits to exist.
As x approaches zero from the left, y gets close to 0 also, therefore
\lim_x\to 0^-f(x) = 0.
As x approaches zero from the right, y gets close to 1, therefore
\lim_x\to 0^ + f(x) = 1.
Since the left-side limit is 0 and the right-side limit is 1, and 0 and 1 aren't the same, therefore
\lim_x\to 0f(x)
does not exist.

Example 2

Let
f(x) =
lr
x + 3 &x ≤ 2
5 &x >2.
Does \lim_x\to 2f(x)
exist?

We graph f:

In order for the limit to exist we need both one-sided limits to exist. As x approaches two from the left, y gets close to 5, therefore \lim_x\to 2^-f(x) = 5. As x approaches two from the right, y gets close to 5, \lim_x\to 2^ + f(x) = 5. Since the left-side limit and the right-side limit both exist and are equal to 5, \lim_x\to 2f(x) = 5.