My university's policy is to consider only the most recent grade for a failed course that has been retaken, how should I declare my GPA? Suppose that I am submitting my application form for admission to a PhD program in USA/Canada. When I am asked to declare my GPA, should I declare it the same original way that my university has calculated it in my transcript?

Here's the thing: I have a failed course in my transcript that was retook the next semester and I have passed it with a good grade. According to my university's policy, when a student retakes a failed course, only the most recent grade is considered in their GPA. So, the GPA that my university calculates is a little bit higher than just averaging all my grades. Should I declare the GPA that my university has calculated as my GPA? Or should I write down the average of all my grades and calculate it on my own?
You should declare the GPA that is written on your transcript and provide the transcript. You should not compute the GPA yourself. This would only introduce confusion. If someone asks, you can simply give the explanation you just gave us. You can even preemptively include an explanation somewhere in your application, with the simple explanation you wrote.