How to fix my iPhone 5? (dropped it but didn't break)?

Yesterday, my phone fell from a short height and it worked fine, but I discovered that it doesn't charge. Today the screen turned black and when I plug it in the charger it just displays the apple logo which disappears shortly and reappears again

Correction: according to the evidence you have presented, it DID break. The damage was merely hidden until you attempted to charge it. You can't repair it, or you wouldn't be asking your question.