When I try to log in on the first screen when you've double clicked the icon it says: "Can not connect to Minecraft.net" when I clearly have wifi. I have to play in offline mode which means I can't update it. Any help?
Minecraft 1.5.1 is now 4 years old. With the Microsoft Buyout, I guess the link to the updater has died. From web experience, they probably removed the server response a year or so after putting the new launcher online, and since you havent updated in years you are one of the installs that has been left behind.
Try to go and get a fresh version at https://minecraft.net/en-us/ (a Minecraft account will be necessary.)
PS: A good first step to verify if you have wifi is well, can you load a web page. But here there's also a catch. A page that was already visited could be loaded from cache. So go on google, and do a search for something like 'Dwarves Scandinavian Death Metal' or something really random that you havent searched before. If it could load results, you are connected. If it doesnt, well, you aren't.
If your Wifi is patchy, I would recommend connecting your PC/Laptop with a ethernet wire to your router. It should help with your connection issues. If you still have connection issues, contact your ISP.