I had a Lenovo smartphone (which now rests in electronic heaven, unfortunately) with which I wished to do the same.
This is known as reverse tethering. The best known method of reverse tethering requires you to root your phone: do note, rooting voids your warranty.If your phone is already rooted, great! If not, here's the safest way to do it without harming your phone.
PROCEDURE:
Download the Towelroot app: https://towelroot.com/ Install it on your phone. Open it and press the "Make it Ra1n" button. If it gives you a message that says that process was completed, you're rooted. Download Root Checker from Play Store and run it once to confirm rooting.
Download Android Reverse Tethering on your PC: http://forum.xda-developers.com/showthread.php?t=1371345
On your Galaxy, open Settings > Developer Options. Turn on USB debugging. Connect phone to PC via USB.
Open Android Reverse Tethering on your PC. Press "Connect".
A Superuser permission request will come up on your phone screen. Press "Accept". Now try to browse the web on your phone.
TO USE THE GOOGLE PLAY STORE ON REVERSE TETHERING:
Open Android Reverse Tethering on your PC again. Don't press the Connect button right now.
Press the "Install hack (optional)" button. Xposed Installer app should open on your phone's screen when you do this.
Install the "Hack Connectivity Service". Now, in Xposed Installer's main menu, select Modules, enable Hack Connectivity Service and restart your phone.
Restart your phone.
Now press the "Connect" button on the Android Reverse Tethering program open on your PC.
You do it as I said and it's guaranteed to work.
P.S. I used Android Reverse Tethering from a Windows XP PC.
IF YOU ARE AFRAID TO ROOT YOUR DEVICE: It's understandable, because I've seen forums full of horror stories where people bricked their phones.
But do note: if you strictly want to do it on XP, forget it. The other method requires Ubuntu, a free operating system. You can create a LiveUSB with persistence, so you can work on Ubuntu without installing it on your PC.
Pre-requisites:
- a Wi-Fi dongle
- a pen drive which you have prepared with a bootable ISO of Ubuntu (plenty of tutorials online if you are a newcomer, though I doubt you're one)
(of course) an Internet connection.
Start up Ubuntu. You can create a LiveUSB stick with persistence enabled to work on Ubuntu without installing it, so your Windows XP installation remains safe without any modding.
Open Terminal and type this:
sudo apt-get install hostapd
Then this:sudo apt-get install dhcp3-server hostapd
Now type
sudo gedit
and copy the following details into it:interface=wlan0 driver=nl80211 ssid=YOUR_SSID_NAME hw_mode=g channel=11 wpa=1 wpa_passphrase=YOUR_PASSWORD wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP CCMP wpa_ptk_rekey=600
Save this file in /home/
directory with the name hostapd.conf
Open Terminal again and type this:
sudo hostapd hostapd.conf
All you have to do now is simply connect your phone to the ad-hoc WiFi network you just created. Enjoy!