It is well-known that in 1755 Lagrange was appointed Professor of Mathematics at the Royal Artillery School in Turin. He was 19. His work up until then involves correspondence with Euler. Was he appointed professor by Euler's recommendation? If not, how was his talent recognised so early?
Lagrange enrolled to the university at the age of 14, to study law. But he quickly switched to mathematics. According to his biography, his mother was surprised when the French ambassador presented himself to congratulate her and give her the prize of the Paris Academy which Lagrange won in a public competition (by correspondence). (His mother was surprised because she assumed that her son was studying law).
In few years he probably made his name known in scientific circles. At that time mathematical results were spread mostly by correspondence, there was no regular, established journals yet. Young Lagrange corresponded not only with Euler but also with Count Fagnano, (probably the most famous Italian mathematician of that time) and several other mathematicians. His first published paper appeared only in 1759, in a journal which he and his friends, who were actually his students, published themselves.
His correspondence with Euler started in 1754, and he was appointed Professor in 1755. The biography does not mention any interference or even recommendation of Euler, but mentions that Euler tried to arrange for him a position in Berlin in 1756. (Euler only succeeded in making him a corresponding member.)
Lagrange was not unique as a prodigy. For comparison, Alexis Clairaut wrote his first research paper at the age of 12. At the age of 13 he was invited to address the Paris Academy, and became a member of this academy at 18.
William Rowan Hamilton was appointed Professor of Astronomy shortly before his graduation from college, at the age of 22.
We may conclude that in 18th and early 19th century, the procedures were much less formal than they are nowadays: the number of mathematicians and the number of positions for them were very small, so appointments were decided on individual merits, rather than following rigid rules, as is the case nowadays. As I understand it, the Artillery Academy simply needed a good mathematician, and there were not many around. So they asked other mathematicians, and Lagrange was recommended.
Ref. I. A. Tiulina, Joseph-Louis Lagrange, "Nauka" Moscow, 1977 (in Russian).