1/0 is not infinity, it’s undefined.
For the function 1/x as x->0 from the positive side the function tends to positive infinity, while as x->0 from the negative side the function goes to negative infinity.
The function cannot be both plus and minus infinity at the same time.