An exam ask me the following question.
Let $r=\{(x,y) \ | \ x \in [-1,1] \ \text{and} \ y=x^2\}$, is the following statement true?
$$r^{-1}=\{(x,y) \ | \ x \in [0,1] \ \text{and} \ y=\pm\sqrt{|x|} \}$$
I have to answer the question by explaining the reason using some referable definition. At first, I was going to use the definition of function and inverse function because I noticed that $r$ is a function from $[-1,1]$ to $[0,1]$, but when I looked at it again, $r$ is not one-to-one and $r^{-1}$ is not a function because it maps $x$ to $-\sqrt{|x|}$ and $\sqrt{|x|}$.
I have been searching for a definition of inverse of a set of ordered pairs to see if it can be useful, but could not find one.
I am wondering what the $r^{-1}$ means in this case. If the question clearly state that $r$ is a function and $r^{-1}$ is the inverse of $r$, I would answer "No" already.
The set $r$ is an example of a relation, which is a simply a subset $R \subseteq X \times Y$ of the Cartesian product of two given sets $X, Y$. For $r$, the sets $X$ and $Y$ are not specified, but we could certainly take $$X = [-1, 1], \quad Y = [0, 1].$$
We say that a relation $R \subseteq X \times Y$ is a function $R: X \to Y$ iff for all $x \in X$ there is exactly one $y \in Y$ such that $(x, y) \in R$. (Note that our choice of $X$, $Y$ makes $r$ a function.) If $R$ also satisfies the reverse, or more precisely that for all $y \in Y$ there is exactly one $x \in X$ such that $(x, y) \in R$, then by definition, the relation $R^{-1} \subseteq Y \times X$ defined by $$\phantom{(\ast)} \qquad R^{-1} := \{(y, x) : (x, y) \in R\} \qquad (\ast)$$ is a function $R^{-1}: Y \to X$; we say that $R^{-1}$ is the inverse of $R$ and that $R$ (regarded as a function) is invertible.
On the other hand, the definition $(\ast)$ makes perfectly good sense for any relation $R$, not just those relations that are functions; so, for any relation $R$, we define the inverse relation $R^{-1}$ by that formula.