The function tan(x) is a many to one periodic function, so to define an inverse function requires that we restrict its domain (or restrict the range of the inverse function).
To define arctan(x) as a function we can restrict the domain of tan(x) to (-pi/2, pi/2). The function tan(x) is one to one, continuous and unbounded over this interval, so has a well defined inverse arctan(x): RR -> (-pi/2, pi/2) that is also continuous and one to one.