How does a pilot know if he has headwind, tailwind or crosswind?
With no visual or instrument references you don't know if you have a headwind, tailwind, or crosswind.
You also don't particularly care because you're flying a plane with no way to navigate and therefore have more imperative concerns.



With visual references it's something you can determine with a little thinking and some intentional oversimplification:


Headwinds mean your ground speed is lower than your airspeed.
If your airspeed is 100 miles per hour and you're flying a 25 mile leg it should take you 15 minutes. If it takes you 18 minutes you know you've got a headwind.
Tailwnds mean your gound speed is higher than your airspeed.
If you're flying the same 25 mile leg at 100 miles per hour and it only takes you 12 minutes you have a tailwind.
Crosswinds are a bit more difficult: The easiest way to tell you have a crosswind is if you know what your magnetic heading should be in order to fly toward a given point and you have to point the nose at a different compass heading in order to maintain the desired ground track you have a crosswind. 


Note that you almost never have a direct headwind, tailwind, or crosswind, but rather some wind at an angle to your direction of travel which will have both a crosswind component and a headwind/tailwind component. The wind speed and direction can be computed using an E6B flight computer with relatively little effort.



If you have instrument references the problem gets easier:


GPS is the ultimate solution -- it can display your ground speed and ground track, from which you can derive the winds. GPS systems that know your airspeed can even calculate the winds for you so you don't need the E6B anymore (unless the GPS breaks).
VORs provide a magnetic heading reference, which simplifies the crosswind calculation (and largely eliminates the need to do one to figure out your crosswind correction angle: Just keep the needle centered and you have your desired crosswind correction).
It doesn't give you the wind speed and direction without some additional data (how long it takes you to cross some waypoint or fix), because you still need that information in order to determine how much of the wind speed is acting as a headwind, tailwind, or crosswind component.
DME systems can give you your groundspeed. In combination with the VOR this gives you the same information as the GPS and makes determining the wind speed pretty simple.
ADFs can be used for this kind of calculation in the same way as you would for a visual waypoint: If you expect to be flying due north to head toward an ADF beacon and you're flying 010 degrees to keep the pointer needle where you want it then you know you're dealing with some crosswind component.