inverse of the function $f(r,\theta) = (r\cos \theta, r \sin \theta)$
set $x = r \cos \theta$, $y = r \sin \theta$ then we have $ x^2 + y^2 = r^2$ so $r = \sqrt{x^2+y^2}$.
Now $y/x = \tan \theta$ so $ \arctan(y/x) = \theta$ for $x\not=0$. If $x=0$ we have $\theta = \text{arccot}(x/y)$ for the inverse.
In the solutions they have: in a neighbourhood of $(x_0,y_0)$ with $x_0 < 0$ we have $\theta = \arctan(y/x) + \pi$ and $\arctan(y/x) = \theta$ for $x_0 > 0$, and similarly for $y_0 >0 $and $<0$ - my question is, where did the $+\pi$ come from, and why do we distinguish if $x,y>0$ or $<0$?
The given function $f$ maps a pair of polar coordinates $(r, \theta)$ to Cartesian coordinates $(r \cos\theta, r \sin \theta)$.
You can fiddle with it here.
The arcus tangens function will return a value from $(-\pi/2,\pi/2)$, which covers only a total angle of $\pi$, not $2 \pi$. That is why they feature the case distinction.
$x > 0$ is for the right side half circle:
$x < 0$ for the left side half circle.
For $x = 0$ $\theta$ should be either $\pi/2$ $(y > 0)$ or $-\pi/2$ $(y< 0)$.
For $(x,y) = (0,0)$ there is no unique inverse.