You should offer a mobile version, never assume that the user wants a mobile, I hate mobile sites because my browser renders html just fine and I do not appreciate being shoehorned in to a display system that results in me disappearing.
You would use the server to determine this, there are various methods of achieving an accurate idea of the user, if its a mobile or not.
If you were to look at the IP address allocation by itself, then you would assume that my IP address being assigned to 3 Mobile that I am a mobile device... WRONG. Its a PC.
Even if I were on a mobile device, I tether my PC to my phone on one network and my home mobile is provided by 3 Mobile through a mobile device that the computer plugs in to via twisted pair, sorry, cat5 to you young-un's
So consider working with your visitors rather than providing what you think that they will want to see when they visit your site on a mobile, tablet or other non-pc system.
Don't forget to offer a way to switch between the two.
I am luck that I can use this trick on facebook to get around them cutting all 32 bit systems, I use the mobile URL's in my browser and that allows my 32 bit system to access the facebook site an post as they have implemented many changes that has led me to stick two fingers up to zuccerberg who is seemingly very myopic in this choice of forcing users to upgrade to 64 bit browsers when I have no 64 bit system...
So be wary of some of the pitfalls of forcing people in to doing things that they either don't want to, don't know how to or have no possible way of doing what is asked...
Not everyone has the same type of internet connection just like not everyone has a fast PC...