SpaceX is not a publicly traded corporation. Thus you cannot buy shares or invest directly in them. SpaceX is only accessible through indirect investment.