I have a wireless router on the first floor of my building and I want to extend it to use the internet on the third floor of the same building, I am thinking to get a log network cable from it till the third floor, but what is the device i will need to run the wireless in the third floor, should i buy a new wireless router and attach to it or what?
You need a wireless access point.
You don't need a router as that has software to control the network which you don't need in this case, though you can use one if that's what you already have.
The access point just connects to the network cable you run up from your router. It may even come with other network ports so you can use it as a wired switch as well.
The access point should have the same SSID as your main wireless network, but should operate on a different frequency so it doesn't interfere with your main wireless router.
The other answerers are right, you need another wireless access point. However, I actually recommend NOT giving it a separate SSID. If you give it the same SSID and security settings (WPA, password, etc) as the others, but let it run on a different wireless channel, then any wireless devices inside the building will automatically switch over to the wireless access point with the stronger signal as they move throughout the building. This is commonly done in corporate situations when a large building needs to have wifi coverage throughout. Have a read of this discussion thread for more insight: http://www.velocityreviews.com/forums/t3972-ssid-for-multiple-access-points.html
Yes, you can use another wireless router. Run the network cable from one of the LAN network ports (not the WAN port) of the wireless router on the first floor to the WAN port of the wireless router on the third floor. Set the third floor wireless router to get it's WAN IP address and DNS settings via DHCP and ensure that the wireless router on the first floor is issuing DHCP addresses. Set the private network range on the third floor wireless router to something other than the network range that the first floor router has.