I'm not going to apologize for something I didn't say
Who thinks you need to apologize?
My friend thinks I said something bad about him, but I never did.
If you did nothing wrong, you don't owe an apology. You shouldn't say sorry for that.
That is what I will say to him.
It is a good idea to tell your friend you said nothing wrong. It was probably a misunderstanding between you two that can be cleared up quickly.