We do not have free will since everything that happens is determined by what has happened before.

If this is true, then how is anything new invented?

Fallacy Of Irrelevant Purpose

Inventing as man-made concept is completely irrelevant to this topic. The topic is about events on atomic scale.