What is the function of the double s at the end of the word, success?
It makes it clear that it's /səkˈsɛs/ rather than /səkˈsis/ or /sʌks/.
Originally, it made the next syllable start with an /s/ sound, even though the last syllable doesn't exist any more.
The Latin verb succedere (from which we get succeed) had a past participal successo and some past historic forms had a similar double-S (successi, successe, successero, succedessi) while some imperfect forms had a double-S but not also the D (succedessi, succedesse, succedessimo, succedeste, succedessero).
The Latin noun successus and it's various forms (successum, successibus and so on) came from that verb.
In these Latin words, that these two Ss are both pronounced, one ending a syllable and the next beginning the next syllable.
This became an English word that was sometimes spelt success and sometimes successe. Even in the second spelling, the final -se wasn't pronounced because English had already stopped pronouncing terminal -e in most cases.
The successe spelling died out around the late 17th Century or so, leaving us with just success.
Still, that it doesn't serve the role it did in Latin doesn't make it solely a historical legacy, as I said at the beginning, it's clear that success is pronounced /səkˈsɛs/ but it wouldn't be as clear rather than whether succes was pronounced /səkˈsis/, /səkˈsis/ ("suckies") or /sʌks/ ("sucks").