To check if a function is continuous at a point, first check if the function exists at that point (if for that x, there exists an f(x)). Then, check if the limit as x approaches that point exists. Recall that this can be done by checking if the left- and right-hand limits are the same. Finally, for a function to be continuous, the value of the function at a point must be the same as the limit of the function at that point.
Let's take a look at another example. I want to ask the question why is this function not continuous at x equals 1? Now recall the conditions for continuity.
They are three of them. First, the function f has to be defined at the point a, in this case 1. Second, the limit as x approaches a of f(x) has to exist. Third, the limit as x approaches a of f(x) has to equal f(a) , the value of the function at a.
Now here the number in question is 1. G(1) does exist, so the first condition is met. Let's take a look at the second condition. Does the limit as x approaches 1 exist?
Well, as x approaches 1 from the left, the value stays constant at 3. So that limit's 3. What about from the right? The limit as x approaches 1 from the right. We're coming along this branch here. We're coming down towards -2. So that limit is -2.
These limits aren't equal. So that means, the limit as x approaches 1 of g(x) does not exist. That means that this function violates condition 2 for continuity. So it's not continuous, because the limit as x approaches 1 of g(x) doesn't exist.