The first method is incorrect for 2 reasons:
(a) If 1/x approaches to infinity, it does not mean yet that f(x) becomes discontinuous
(b) Actually, 1/x does not approach to infinity. It approaches to infinity on the right and to negative infinity on the left.
But the second method is correct. You should find 2 limits: when x approaches to 0+ and when x approaches to 0-. (You claimed that you found these limits.)
If the both limits were equal to 1, f(x) will be continuous function. Otherwise, it is not continuous at x=0.
Meesam T.
Thanks for the answer.I was just confused because generally when I do something wrong I get a wrong answer but this time I got the same answer both times.So anyways thanks for the answer again.11/09/21