tan(x) = sin(x)/cos(x), and cos(x) crosses zero at x = pi/2, so tan(x) blows up there. Approaching from the left it goes to +infinity, but approaching from the right it goes to -infinity — since the one-sided limits disagree, the two-sided limit simply does not exist, making it an invalid/undefined limit rather than a single value like +infinity.