Sustainable development (SD) has covered all our spheres of life, including education. The acquisition of high-quality education is the basis for improving people's lives and sustainable development. Education for Sustainable Development (ESD) allows people to change the way they think and work for the sustainable future. According to Goal 4 written in the Sustainable Development (SD): "Ensure inclusive and equitable quality education and promote life-long learning opportunities for all", lifelong learning competences take an important place in the SD. Lifelong learning highlighted eight competences. The main task of studying mathematics in universities is to develop such lifelong learning competences as mathematical competence and learning to learn competence. Learning to learn competence is characterized by: i) knowledge of the learning to learn competences; ii) learning skills competences (fundamental basic skills and management of one's learning); iii) positive attitude competences. The aim of the study is to analyze the competences required for lifelong learning, to study contribution of mathematics in their development and to identify the Latvia University of Life Sciences and Technologies students' learning skills competences and reasons for insufficient preparedness for mathematics tests. Results of the survey of "Knowledge of the learning to learn competences" show that only about 30% of students know their preferred teaching strategies and about 40% of students have the ability to overcome their obstacles, find training opportunities or available support. As regards "Learning skills competences" a large problem is the ability to manage one's time (more than 80% gave a negative answer or partly negative) and the ability to organize the learning process (more 75% gave a negative answer or partly negative). It is pleasant to note that about 50% of students have "Positive attitude competence", they get positive emotions for solving problems and have the ability to use previous experience. Unfortunately, one of the main reasons for insufficient preparedness for mathematics tests is laziness. Almost a fifth of the students admit that they are too lazy to learn, prepare for tests and strive for the highest score.