Apologies in advance if this has been discussed already.
The idea of Jack having a son in the afterlife/samsara/sideways is one of the most interesting things about this season. He's the son of /the/ major character. However, he didn't really exist. In Jack's life on earth he had no son. So the question is, who is David? The writers never gave us an explicit answer.
I say that David is Jack. If you watch the interaction and overall storyline of David and Jack, it's really Jack being father to himself in a way that resolves all of the issues he had with Christian. In the sideways, David represents Jack as a child and Jack walks in Christian's footsteps and comes through as a good father. He was able to finally 'be there' for his son by taking time away from his busy schedule to attend the piano solo. Don't forget, Jack was a piano player.
Notice David was not in the church at the end. It's because David /was/ Jack.