There are several reasons for that, possible causes:
your disk have hardware failure, like I/O errors...
You have multiple firewalls enabled, and it is better to have only one, maybe "gufw" is the best... and it needs to deny all with rules to allow out udp 53 and allow out tcp 25,53,80,110,143,843,993,5060,8080
Your OS is not with all modules inserted, type:
lsmod > list1.txt
Then create an USB installer with the "startup disk creator" using the ISO of your installation CD (a pen of 2 GB is enough) then boot from that USB PEN and choose "try Ubuntu" and type there:
lsmod > list2.txt and copy this file to the same location the one above and open both in text editor and see if there is missing modules in list1.txt...
To install missing modules use first
modinfo <name of the module> after the description see if it needs dependencies and install those first if not, just copy the full path of the ko file and type sudo
insmod /path/to/file.ko", after all modules inserted no need for reboot things should start working fine...
If you do not use proprietary driver, then might solve the problem due to the fact that the CPU is having trouble to process all the system in realtime, and that lack of CPU speed and Bridge speed causes wi-fi to disconnect, so try to install proprietary driver for your wireless card or disconnect every USB device that is not needed by your system to connect to the internet. If you do not find how to do this, go to "software center" and search "additional drivers" and if not installed, install it, then start it and activate all drivers available cause it will speed hings up and using less CPU...
This one is certainly your case, you are booting from an USB disk and using very fast speed which causes system resources to collapse, and has to shutdown one, and because the USB disk is the boot disk it chooses to disconnect the Wi-Fi! Solution is to connect the USB disk to an hub of less speed, like if was connected to USB3, use an USB2 hub which causes the USB disk to work at USB2 speed, if it was using USB2 then use an USB1.1 hub...
This is a long shot, and at far, your browser internet agent got corrupt or hacked by some intermediary that poses for an "authority" of contents provided by you, but this is a false authority, and just a cyberbulling occurence, cause there is no internet content that violates internet rules set by the internet authorities, and besides that you or anyone do not have nothing to do with the contents received, because everyone just enters the URL and the server decides which content to send, like, if two guys access the same URL at the same time, they get different pages content cause the server sends data according to lots of parameters and is configured to apply local country rules, like nudity can be considered ilegal in one country and not in other country. There is also the copyright issue but this also is not possible to violate, cause the copyright is not the act of making copies but the act of posing to be the author, that said, if one uploads copyrighted material without trying to own the copyright does not violate any internacional copyright rule. This two are the most common accusations by false "authorities" which makes your agent set your browser ID has an internet criminal act origin, causing every server in the world to disconnect that browser has soon it processes the browser agent, which sometimes takes several minutes...