How does a spinning object "know" that it is spinning? I am constructing a thought experiment about a spinning object that is floating in intergalactic space.  I assume that this object is about the size of a planet so that it will have enough gravity so that a Foucault pendulum will work, although I'm not sure that this is necessary for the thought experiment.  
I can easily determine that this object is spinning if I stand on the object and observe the galaxies around me rise and set.  Similarly, I can determine the axis of rotation.  
For simplicity, I go to one of the poles of my object, and I set up my Foucault pendulum.  What will I see?  And why will I see it?  I assume that in intergalactic space, the gravity is very small (galaxies are very far away, and the mass of my object is very small compared to the mass of a galaxy) so that there will be little coupling between the gravitational field of my object and the gravitational field of the galaxies around me.
 A: How does a spinning object know it is spinning?
Let's step back. How does an object spin? First imagine a rod, if you stretch (strain) the rod to be longer than its natural rest length then like a spring there is a force (stress) on the parts trying to compress it.
An object spins when it has some velocity in one direction and yet it the orthogonal direction it is too long (strained) so it has a stress in the orthogonal direction. You could imagine a spring with masses on the two ends. At rest it has a particular length.
When it spins it is longer and the two masses have a velocity orthogonal to the spring. It's literally longer and the parts are literally moving with respect to each other.
There is no way at all in which it is any way like the stationary spring. Just because it didn't stretch much doesn't mean it isn't stretched. A spinning object bulges at its equator, that's how it  spins.
Now as for how you know. You could look at the parts and notice they are strained by measuring their separations between each other and considering the materials they are made of and how far apart their natural separations are you see that they are too far apart (that's measuring the strain). You can also measure the stress. You could also use the comoving coordinates of the parts as a reference frame and check to see if Newton's laws hold without fictional inertial forces (they won't). You could take something that moves through a vacuum at a steady speed such as light and send it around one way and then send it around another way and see if they get around in the same amount of time (they won't).
A rotating object and a not rotating object are different and there are thousands of ways to tell the difference. It's a bit absurd to even imagine they are similar in any way. Spin a spring and literally watch it get longer. What's confusing about that in the slightest?
A: The basic rule is that space has no "origin", so only relative coordinates are possible. Thus, motion is relative and only meaningful with respect to other objects.  Now we also have all directions being equivilent so you have no preferred axes, and orientation is only relative too.
But, starting with that, working out what are essentially Newton's laws of motion, you discover that angular velocity is not relative, as it links up with linear acceleration.  That's the same thing: given no absolute position you find you also have no absolute motion (first derivitive) but do have absolute acceleration (second derivative).
Just start with the idea of no absolute position/direction and follow the math: when do absolute quantities pop out, and when do they not? 
A: This is indeed a Big Question; you have essentially stumbled into Mach's principle. 
For an even more bewildering version: suppose that in that bit of intergalactic space, you have two spherical objects, which are rotating relative to each other about their separation axis, with the distant stars stationary with respect to object 1. Our current understanding of physics is very clear that a Foucault pendulum on object 1 will not precess, but if placed on a pole of object 2 it will precess relative to object 2 (and keep in plane with a pendulum on a pole of object 1). The reasons for this, however, are not as clear, and if I understand correctly they are still a matter of debate, but maybe someone closer to that field can clarify.
A: While we may not be able to define a universal rest frame (Galilean invariance), we can still tell when frames are non-inertial. A spinning frame of reference is non-inertial, and thus there are non-inertial forces that arise, which we have ascribed to being "fictitious," which means that they are not fundamental, but rather a poor choice of reference. If we believe Newton's law to be what governs the universe, then we will always be able to tell a spinning frame. You can even tell how fast your frame is spinning just from local experiments, without needing an external reference frame such as the stars (e.g., the pendulum you mentioned). At either pole you will get a pendulum precession period equal to the rotation period of the planet.
Now the philosophical question about what is fundamental and what isn't, is essentially what I make of Mach's principle. And it's just that, a philosophical question.
A: I wouldn't even get so complicated as the other answers and would just consider the Coriolis effect https://en.wikipedia.org/wiki/Coriolis_force on a pendulum. Or if you are trying to hit something with artillery.
A: How does a spinning object “know” that it is spinning?
In short: because it can "feel" it.
What does spinning mean for an extended object? If we consider the extended object as a bound system of elementary ones then it is spinning whenever it is able to maintain its cohesion (its shape) while its elementary parts all want to well, part.
To see this, imagine you have a magic switch able to cancel all cohesive forces in a wheel. If the wheel is not rotating, you can toggle that switch on and off and will not observe any change. But if its spinning, then once you turn cohesion off you will see the wheel disintegrate, each of its parts going away in a straight line, in inertial motion.
Yet, consider the whole disintegrating cloud of elementary parts: its angular momentum is unchanged: it is still spinning, in a sense. See this related answer of mine for a more detailed, and quite relevant, discussion,.
Angular momentum is conserved for any group of inertial subsystems, bound or unbound. That is what rotational inertia really amounts to: conservation of angular momentum. But when analysed as above (and again, here), rotational inertia is only another expression of plain inertia; it is not another phenomenon. Add cohesion to an ensemble of elementary objects, and the overall effect of their inertia will be the spinning of the overall, bound, system.
What is important here is that it does not matter what boundary we give to a spinning system. Conservation of angular momentum applies to any arbitrary system of parts. Seen this way, Newton's bucket is in fact spinning relatively to itself. If you turn the magic toggle on, all the molecules in the bucket will move their own way, and the bucket will disperse; so the bucket "knows" it is spinning because its cohesive forces have to fight that dispersion (the most visible end result of this fight being the concavity of the water surface).
What about Mach's principle then? Well it seems to me that the question of whether space is absolute or not was in fact never what Newton's bucket is about. Spinning is absolute but there is no need to invoke distant galaxies or space itself. Newton's bucket does not need any referencial framework outside its own structure as a bounded object. It is because it is bounded that, when it is made to spin, plain Galilean inertia causes the reaction of cohesive forces to change some of its structure (shape of water surface, but also pression against its wall).
The trick is that considering a complex bound system like a bucket half-filled with water makes it very visible and clear that something is happening between inertia and structural integrity. This makes strikingly clear that spinning is absolute. But while it is absolute in the sense that it does not depend on a frame of reference, it is also local and relative to a well-defined system. Would the same bucket with no internal cohesion, an ever-expanding cloud of particles still maintaing its overall angular momentum, lead to the same speculations about the absoluteness of space? Which part of the cloud would we ask how it knows the cloud is spinning? None of those parts would feel that spin. It is only our arbitrary definition of the overall system that gives a meaning to the question "does it spin?".
So my final answer is in two parts:

*

*an inertial object devoid of internal structure does not ever spin (at least in a classical sense - quantum mechanics does take this notion to the next level).


*the reaction of internal cohesion to fragmentation via inertia is what makes an object "feel" that it is spinning.
Taking 2) at the scale of a whole planet, "cohesion" includes all possible planet-wide internal interactions and "fragmentation" all types of stress. A Foucault pendulum is then one of the ways to "feel" the rotation - as a part of the spinning system, it conveys the feel to another part of the system, the experimenter.
A: The obscure principle of angular energy will settle the matter.
The spinning object has angular momentum, which means that most of its particles have ordinary momentum about the center, which means they possess kinetic energy, and therefore by $E=mc^2$, we know they possess gravitational attraction what we can measure if we are precise enough.
Please note that we must use special relativity here only because we need mass-energy conversion. With pure Newtons mechanics we cannot easily prove mass-energy equivalence (I can get so far as $E=mk$ but it doesn't help because due to the way it is reached the formula no longer implies that $m$ further induces gravitational forces).
A: I have received an answer but I do not understand it.  It uses relativity and the Lorentz contraction.
Let us assume for sake of discussion that I am standing on the equator of my intergalactic planet.  Let us assume further that there is a distant galaxy which is co-planar with my intergalactic planet.  At some point, when I am standing at a right angle with respect to the line going from my planet's core to the distant galaxy, the light will be slightly blue-shifted, because I am moving towards it.  Half a revolution, the light will be slightly red-shifted, because I am moving away from it.  Similarly, the effective mass in the neighborhood of where I am standing will slightly increase and decrease.
The reason for my confusion is that suppose there is another galaxy which is co-planar to my planet and at right angles to both the axis of rotation and the line from the core of my planet to it.  Now the effective mass is going to vary because of both the first galaxy and the second galaxy, but the effective mass is going to change out of phase.
Unfortunately, I did not think about this second paragraph until last week and I got my answer over a year ago.
A: There's a simple answer to this question, which the other answers did not address: by using gyroscopes.
You can distinguish between inertial and non-inertial frames of reference by the use of accelerometers and gyroscopes.
There are two very different kinds of rotation: the rotation of a body around its own axis of rotation - due to the contact force among the rigid body, and thus non-inertial rotation - and the inertial rotation of a body around a celestial body - due to the field force of gravitation, and thus inertial rotation.
In the first case, there's centripetal acceleration, the bodies parts are cast away from the centre by a fierce force outwards, and if you are facing the center then you keep facing the center, like in a merry go round.
In an inertial rotation, subject to a force field, like the gravitational one, the rotating body fells no outwards force, and just rotates around center facing exactly the same direction on space.
Edit to illustrate a bit better: proper acceleration is absolute, while coordinate acceleration depends on the observer. The same goes to rotation, a gyroscope maintain its orientation in space so you can tell if you are rotating. A body that undergoes rotation in a merry go round will see the gyroscope changing direction, because it is in proper rotation, a body orbiting a planet does not see change in the gyroscope because the body always points to the same direction in space.
Edit to better address the OP's question: whether you use a gyroscope or a Foucault pendulum, you can tell proper rotation of the Earth around its axis without having to resort to external references. If you are put on a closed box, without ever seeing the exterior, you can use a gyroscope or a Foucault pendulum to tell that you are rotating. Furthermore you can even tell your latitude on the planet by just observing the rotation of the pendulum.
At a planet's pole the motion of the pendulum is perfectly circular and its period is exactly the period of the rotation of the planet around its axis.
This is due to the fact that proper acceleration is absolute, its measure does not depend on external references, both in linear motion and in circular motion, due to the contact forces you feel. In contrast, free motion on the geodesic of the gravitational field cannot be felt, and you need external references to tell your motion. The rotation you feel at the pole is absolute rotation, because of the contact forces between you, the pendulum and the planet's crust. It does not depend on the gravity of external sources.
A: I read a lot of answers here about the acceleration being absolute, which would imply the rotational motion is not relative like linear motion. But the situation is the same as a linearly accelerated observer in space. This observer can say she finds herself in a uniform gravity field, while being at rest. Likewise for the observer in a rotating body (rotating according to us).
