There has been a wide range of discussion in Islamic history about the background and the derivation of this term and I would like to mention a few as told by Imam Abul Qasim Qushayri (r.a) in his renown Sufi work called Al Risala Al Qushayriyya Fi ilm al Tasawwuf (Al Qushayris Epistle to Sufism). The Arabic term safa or صفاء means "purity" and "a man of purity" is referred to as rajul sufi - رجل صوفي with the word sufiyya - الصوفية being the plural. The plural sufiyya in Arabic came to be known as Sufis (& sufism) in English. It is also claimed that it may have derived from the word suf - صوف which means "wool"; therefore, the verb tasawwuf - التصوف would mean “to wear wool” because the people of this path were famous for wearing it. Then there is a claim that sufi - صوفي is derived from the word “row” (saff) - صف, meaning that they (sufis) are in the front row in all jamaats (prayer congregations) with their hearts and before Allah ﷻ. There are also those who argue that the sufis derive their name from the "covered room" (suffa) - صوفا, the room adjacent to the Prophet Muhammad's masjid in early Islam which sheltered the most poorest of his companions, and were fed and taken care by him and his family. Despite that many of these terms have been considered as origins of sufi yet they are challenged by others on linguistic and etymological grounds. I believe that a comprehensive definition of the term sufi and sufism is given by Abu Muhammad Al Jurayri (r.a), the disciple and successor of Junayd Al Baghdadi, the famous sufi of Baghdad, who said "It means assuming every sublime moral character trait and giving up every lowly one." This definition sums up for us the primary purpose of why Allah ﷻ created humans, as per Quran and a sufi is someone who struggles to fulfill that purpose to the best of their ability.
 Al-Qushayri’s Epistle on Sufism, Al-Risala al-qushayriyya fi ilm al-tasawwuf
Abul-Qasim al-Qushayri, Translated by Professor Alexander D. Knysh, Reviewed by Dr Muhammad Eissa