What is this topic (competition questions)?

I discovered the following question by accident, and found it interesting, but I only resolved it by brute force:

Problem: Let f: $\mathbb{R} \rightarrow \mathbb{R}$ have the property $(\pi)$ iff they satisfy the equation

$$f(s^2 + f(t)) = t + f(s)^2$$

Determine the family of all functions with the property $(\pi)$.

Solution: If we can show $f(0) := y$ to be zero, then letting $t$ run over all real values, with $s = 0$, shows $f(f(x)) = x$ $\forall x \in \mathbb{R}$, from which it is clear that $\mathrm{Id}(x)$ has the property $(\pi)$.

Taking $s = 0, t = 0$ shows (1) $f(y) = y^2$. Taking $s = y, t = 0$ shows (2) $f(y^2 + y) = (f(y))^2$, so that substitution from (1) gives (3) $f(y^2 + y) = y^4$. However, letting $s = 0, t = y$ shows (4) $f(y^2) = y + y^2$, so that $f(f(y^2)) = y^4$ by substituting the LHS of (4) in (3), while letting $s= 0, t = y^2$ shows directly that (5) $f(f(y^2)) = 2y^2$. Equating (4) and (5) says $2y^2 = y^4$, so $y = -\sqrt{2}, 0,$ or $\sqrt{2}.$

Assume $y = \sqrt{2}.$ Letting $t = f(y^2), s = y$ says (6) $f(f(f(y^2)) + y^2) = f(3y^2)$ $= f(y^2) + (f(y))^2$; but $s = \sqrt{2}y, t = y$ says (7) $f(3y^2) = (f(\sqrt{2}y))^2 + y = (f(y^2))^2 + y$. Since $(f(y))^2 = y^4$, $f(y^2) = y + y^2$, equating the RHS of (6) and (7) leaves

$$f(y^2) + (f(y))^2 = (f(y^2))^2 + y \implies y + y^2 + y^4 = (y^4 + 2y^3 + y^2) + y \implies 2y^3 = 0$$

which is absurd. Assuming $y = - \sqrt{2}$ and setting $s = -\sqrt{2}y, t = y$ in (7) similarly shows that $y \neq - \sqrt{2}.$ We conclude that $f(0) = 0$.

That $\forall x \in \mathbb{R} (f(f(x)) = x)$ says that $f(x) = f^{-1}(x);$ this requires that $f$ be one-to-one. Since $f(0) = 0$, we have $t \neq 0 \implies f(t) \neq 0$; we can now show that $f$ is increasing. Pick $x, y \in \mathbb{R}, x < y,$ and set $\delta = y - x.$ By choosing $t = f(x), s = \sqrt{\delta}$, we have

$$f(\delta + f(f(x))) = f(\delta + x) = f(x) + f(\sqrt{\delta})^2 \implies f(x + \delta) - f(x) = f(\sqrt{\delta})^2$$ $$\therefore f(y) - f(x) > 0$$

since we established that $f(\sqrt{\delta}) \neq 0$. This proves that $f$ is increasing. Since, in fact, $\mathrm{Id}(x)$ is the only $f: \mathbb{R} \rightarrow \mathbb{R}$ which is both increasing and an involution, this says that $f(x) = x$ is the sole function with the property ($\pi$).

So several things:

1) What field(?) of study does this question come from? Is it relevant to quotidian mathematics?

2) This was tricky. It took a lot of messing around with various combinations to get the main result, and I had the uncomfortable feeling that I was being inefficient. (I filled up a page and a half of notebook!) Does anybody know any books/have any advice on how to improve on questions like these?

3) If this is its own field, what other fields are best connected with it? (i.e., furnish handy tools)

-