In this note we determine the general solution of the equation $f\varphi f=f$, where $f:X\to Y$ is a given function and $\varphi:Y\to X$ is an unkown function ($X$ and $Y$ are arbitrary nonempty sets). The general solution of that equation is given by the formula (4), where $\varphi_0:Y\to X$ is a particular solution, $k:Y\to X$ and $h:X\to X$ are arbitrary functions, $F:X^3\times Y^3\to X$ is defined by (3).