Vályi was born in Marosvásárhely, which was a famous town for any Hungarian mathematician to be born in given the connection with Farkas Bolyai and János Bolyai. He attended school in Marosvásárhely where he showed his mathematical abilities but was a shy boy who mixed little with friends. After graduating from school, he went to Kolozsvár, the capital of Transylvania, where he attended the university. The University of Kolozsvár was a newly established university when Vályi entered it, being founded in 1872. Unlike some others it was independent of the Church and it was set up with mathematics as an important subject, since from the very beginning it had a faculty of mathematics and natural sciences.
After qualifying as a teacher of mathematics and physics from the University of Kolozsvár, Vályi was awarded a scholarship to allow him to undertake further study abroad. This scholarship enabled him to spend two years studying at the University of Berlin where the remarkable team of Kummer, Borchardt, Weierstrass and Kronecker were lecturing. It was at this time that he began to undertake mathematical research, at first solving problems posed in the journal Müegyetemi Lapok. His doctoral dissertation was on the theory of the propeller which led to his developing a theory of partial differential equations of the second order. His thesis was published at Kolozsvár in 1880 and in the following year he became a dozent at the University of Kolozsvár.
Vályi was appointed professor of theoretical physics at Kolozsvár in 1884, and in the following year he also became professor of mathematics lecturing on analysis, geometry and number theory. Let us mention one particular problem he considered. Suppose we are given a triangle. Then the pedal triangle is that formed by the feet of the altitudes. The second pedal triangle of the original triangle is the pedal triangle of the pedal triangle, and the nth pedal triangle is the pedal triangle of the (n-1)st pedal triangle. Vályi asked which triangles are similar to their nth pedal triangle (that is, they have the same angles). For n = 1 there are two such triangles, for n = 2 there are 10, for n = 3 there are 54, for n = 4 there are 228, for n = 5 there are 990 and for n = 6 there are 3966. Vályi also made extensive studies of projective geometry, in particular studying polar reciprocity, and used elliptic functions to study third order curves. One of his favourite number theory problems was to find all triangles with sides of integer length whose area and perimeter are given by the same number. Vályi showed that there are precisely five triangles with this property.
Vályi's eyesight deteriorated rapidly and he had to lecture without notes for he could not read them. One of his students described his lectures (see for example  or ):-
In his lectures Vályi dealt strictly with mathematics, refraining from any, say, philosophical remarks. He went through the tiniest details of calculations with great care, and practically no mistakes thanks to his extraordinary skill at calculation. The amount of material covered was always considerable, but everything was clearly arranged which, together with his splendid memory, enabled (and his eyes also compelled) him to speak without notes. Vályi's lectures did not always follow the same pattern. Of the special literature read aloud to him regularly every year he could pick up and fit in his lectures those items which made the course more perfect. Thus much of the material gradually built up to improve texts even in the less than authentic form published by the students. There were two courses of Vályi which hardly changed over time. One of them presented the basic theory of functions; in it Vályi followed his old master Weierstrass and included the theory of elliptic functions. The other concerned with János Bolyai's "Appendix"; in that course Vályi, especially in the first years stuck to the order and contents of the sections of Bolyai's masterpiece.Vályi remained in Kolozsvár all his life despite being offered a professorship in Budapest. He retired in 1911 since, unable to see, he was totally reliant on his memory to give lectures and he felt that his memory was beginning to fail. It is a mark of how seriously he took his responsibilities that he retired immediately when he felt that he was no longer able to give his students the quality of teaching that they deserved.
After Vályi retired he went to live with his brother Gábor who had also retired by this time. After his death these words were said in a tribute to him (see for example  or ):-
The tragedy of the life which has now ended is that his frail body hindered the full use of the intellectual power which he possessed in abundance. Vályi's accomplishment, however, is outstanding and lasting ...
Article by: J J O'Connor and E F Robertson