Borrowed from Late Latin praefixum, from Latin praefixus, past participle of praefīgō (“to (fix, fasten, set up) in front, to fix on the (end, extremity)”) (from prae- (“before”) + fīgō (“to fix, to fasten, to affix”)).
Practice speaking and memorizing "prefixo" and many other words and sentences in Portuguese.