If we restrict the domain of cos to [0, pi] then it is a one-one function onto its range [-1, 1] with inverse arccos.
So arccos is defined to have range [0, pi],
If theta in [0, pi] then arccos(cos(theta)) = theta
If theta in [-pi, 0] then arccos(cos(theta)) = -theta
If theta = varphi + 2n pi for some n in ZZ then arccos(cos(theta)) = arccos(cos(varphi))