How to use despite and inspite? [closed]

Both of those are fine. Despite functions as a preposition, and takes a Noun Phrase, very often a clause headed by a gerund (-ing form)

The past form despite having fractured is more precise, but the simple form despite fracturing is perfectly good, and I think most people would say it in ordinary speech. The NOW (News on the Web) corpus shows 8201 instances of despite having [pp] against 180,158 of despite [verb]ing, though there's no easy way of determining how many of the latter could have use the having form.

You mention in spite in your title, but not in the question. In spite of (three words) can always replace despite. It is much less common in the NOW corpus: 3883 of in spite of [verb]ing, 219 of in spite of [pp]. But I think it is more common in speech.