There is a linguistic reason for this writing (concerteza), but for now you must write 'com certeza'. Many expressions change meanings along time and, later, sometimes change the way of writing as well. There are many examples. At the moment, ALWAYS prefer 'com certeza'.