Gatsby invents his life story in order to be in the same class as Daisy. He lies about his birth and family. Why and how?
Gatsby does not invent his whole life story. There are elements of truth in the tale he relates to Nick and others. For example, he did attend Oxford University in England, and he did serve in World War I.
Fitzgerald creates Gatsby's character to demonstrate that those with Old Money (such as Daisy and Tom) are unaccepting of others even if those others have earned their wealth and might even possess more than they do. Gatsby knows that even though he once had Daisy's love as a young soldier, he would never have been allowed to marry her with his low middle class background. He feels that life in Old Money society is largely illusionary; so why not create an illusion himself. His plan almost works. Even though Daisy surely knows that Gatsby's life story is untrue, she overlooks that because others almost view him as her equal. In the end, however, her Old Money tendencies take over, and she abandons Gatsby and his sham for Tom.
It is interesting that even though Gatsby believes that it is necessary to lie to Old Money and New Money folks to accomplish his goals, he eventually tells Nick his true life story. Because Nick is a member of the middle class like Gatsby, Gatsby most likely assumes that Nick knows why Gatsby would lie about such elements of his life.