During the years they spend in university, many mathematics students develop a very poor conception of mathematics and its teaching. This fact is bad in all cases, but even more in the case of those students who will be mathematics teachers in school. In this paper it is argued that the history of mathematics may be an efficient element to provide students with flexibility, open-mindedness and motivation towards mathematics. The theoretical background of this work relies both on recent research in mathematics education and on papers written by mathematicians of the past. Opinions are supported with examples. One example concerns a historical presentation of ‘definition’; it was developed with mathematics students who will become mathematics teachers. For students oriented to research or to applied mathematics, an example is presented to address the problem of the secondary-tertiary transition.