a begginer's question about limits

doesn't limits define when f(x) becomes undefined(changes it's behavior and becomes dis continuous??) as x approaches a real number a??

i could not understand the following example:

( x ^ 2 + x - 2 ) / ( x - 1 ) = ( ( x - 1 ) ( x + 2 ) / ( x - 1) ) = x + 2 ,provided x does not equal 1.

it follows that the graphs of the equations (the first one) and (the second one ) are the same except for x = 1.

1- lim f(x) = 3 as x approaches 1 ,as the equation is f(x) x + 2

2- lim g(x) = 3 as x approaches 1 , as the equation is g(x) = ( x ^ 2 + x - 2 ) / ( x - 1 )

3- lim h(x) = 3 as x approaches 1 ,as the functions is:

h(x) = { g(x) if x is not equal 1 ,and 2 if x = 1

could not understand the piece-wise defined function ,isn't g(x) supposed to become undefined as x = 1 then how the limit of the h(x) = 3 ?? and what does 2 mean in this piece-wise defined function (h(x)) ??

as for f(x) it is a continuous function ,correct???and as for g(x) it is a dis continuous function at x = 1 ,correct?

and here is another question ,it says prove that :

lim f(x) = 1 /x as x approaches 0 does not exist.

doesn't f(x) becomes undefined as x = 0 ,then how the limit of f(x) as x approaches 0 does not exist?