How can I know who is accelerating? – Inertial reference frames and relative motion Suppose I (observer $I$) am standing somewhere in space. I see a region in which my friend ($F$) is accelerating in some direction $\mathrm{\mathbf{\hat{u}}}$. Suppose I see everything in $F$ accelerating in the same direction.
My question is: how can I know if I am an inertial frame of reference or if they are (in which case I am accelerating in the $-\mathrm{\mathbf{\hat{u}}}$ direction)?
 A: Here is how to do it if your own mass is sufficiently small (not the mass of a planet or something like that):

*

*Hold some ordinary object such as a small glass ball (a marble), or a rock, or an apple, or a bunch of keys, near to you at some comfortable distance.


*Let go. I mean: just release the object, like dropping a ball.


*If the object accelerates relative to you, then your body is not an inertial frame of reference. If the object stays still or drifts off at a constant velocity relative to you, then your body is an inertial frame of reference.
For added confidence you should check that the object was not being accelerated by an electric field. For that, you can either make sure there is no electric field at your location, or make sure the object has no net electric charge. There are various methods to check such things.
As GiorgioP pointed out in a comment, the above ignores the gravitational attraction between your own body and whatever you released. There are two ways to take that into account. You could in principle calculate it and then spot whether the acceleration of the dropped object is different from the one it would have owing to gravitation of your body alone. Or you could drop objects at various distances away from yourself, and extrapolate or fit a curve or otherwise use the data to determine what the motion would be in the absence of gravitational attraction to yourself.
A: 
Suppose I see everything in F accelerating in the same direction; e.g., if my friend throws a ball up, it would come back to his hand, as he is accelerating...

No, it would not necessarily.
First of all, your experience with a ball "com[ing] back to his hand." Is seemingly based on the common experience of throwing a ball in the approximately uniform gravitation field of earth. Is your friend floating in space like you? If so, there is not necessarily a uniform gravitational field pulling the ball back to his hand.
Second, ignoring the possibility of gravitational fields for now, if your friend is accelerating, then there is some net external force that is being applied to him. If your friend is holding a ball, then that force is transmitted to the ball as well by his hand. But once he throws the ball it is no longer touching him and is no longer necessarily subject to the same net force as is presumably still being imposed on your friend.

My question is: how can I know if I am an inertial frame of reference or if he is?

If you feel an acceleration, then you are probably not the one in an inertial frame. You can feel an acceleration because you can often feel the net force on your body.
Of course there are other complicating factors, like the equivalence of inertial and gravitational effects as well as the fact that your acceleration might be so small (or so much a part of your typical experience) that you don't notice it.
A: 
how can I know if I am an inertial frame of reference or if he is (in which case I am accelerating in the −u^ direction)?

Use an accelerometer. If your accelerometer reads 0 then you know that you are inertial. If your accelerometer reads something other than 0 then you know that you are non-inertial. This is irrespective of anything else, i.e. it doesn't matter what you observe happening elsewhere.
A: Dale's answer correctly gives the direct manner in which one can distinguish who is accelerating via an accelerometer. Something feels unfulfilling, however, about leaving the implicit question of "what exactly is acceleration?" at "whatever an accelerometer says". To fully address the question, then, I feel it also merits discussing the underlying physical principles which make this distinction possible: why are your and your friend's perspectives not equivalent? What is the accelerometer fundamentally picking up on to make the distinction?
At the heart of this issue is clearly understanding Newton's second law, and all that it entails. It is vital to recognize that $F = ma$ asserts much more than it may appear to at face value. To quote my answer here:

When we put forward $\vec F = \frac{d \vec P}{dt}$ as a means of modelling classical dynamics, then, we are postulating that matter is comprised of particles with well-defined masses and momenta; we are postulating that there exists some exhaustive collection of fundamental interactions of matter, and that to each of these there is associated a vector $\vec F_i$ (i indexing over the interactions), called its force, on every particle of matter; furthermore (in a Galilean context), we are postulating that there exists a family of reference frames, called inertial frames, within which the equation $\sum_i \vec F_i = \frac{d \vec P}{dt}$ is true for every particle of matter (and hence for systems composed of them). By observing real-world dynamics, we hypothesize what the fundamental interactions are and what the vector force associated to each is. We then put these into our model $\vec F = \frac{d \vec P}{dt}$ and see how well it predicts what we see.

The third postulate is crucial: in order to make sense of Newton's second law, we must postulate the existence of a preferred family of frames in which it holds. This is necessary because we can easily see (by transforming between frames which accelerate relative to each other) that it cannot be true in all frames. This leads us to the conclusion that the notion of an inertial frame is intimately tied to our identification of the fundamental interactions and our model of their forces: we identify the inertial frames associated to a model of the collection of fundamental forces as those frames in which non-accelerating objects have $\sum_i \vec F_i = 0$ according to the model. In the current regime of classical mechanics discussed above, we know of exactly two candidate fundamental interactions, gravity and electromagnetism, which together do an exceptional job of modeling nearly all classical phenomena, and hence we define the notion of an inertial frame relative to these.
So, how can you tell which of you and your friend isn't "truly" accelerating according to this picture? By determining which, if either, is subject to zero force according to our understanding of the fundamental interactions. If your friend has a rocket on his back and you don't, say, that's a good indication. If you're accelerating relative to each other, at least one of you must be subject to some nonzero fundamental force.
And what does an accelerometer do? It precisely measures the electromagnetic force, according to our very successful models, on an internal "proof mass", dividing by that mass to obtain the acceleration of this object as it would be measured in an inertial frame, provided this is the only fundamental force present. Finally, note that the modern picture of gravity in Einstein's general relativity is that its associated vector force is identically zero (upon appropriately translating this discussion into the relativistic context), so the detected electromagnetic force really is all we expect there to be, and an accelerometer indeed measures the inertial acceleration.
The question of who is accelerating in the modern sense therefore reduces to: who is subject to a net electromagnetic force? Recall that this includes normal forces, fluid pressure, friction, tension, spring forces, radiation pressure, etc.
A: Newtonian mechanics defines an inertial frame one way, relativity defines it another way. Andrew Steane's answer gives a correct method of detecting inertial motion according to the relativistic definition. However, nobody has yet given a correct analysis according to the Newtonian notion. Because gravity is treated as a force in Newtonian mechanics, there is really nothing in Newtonian physics that you can do to determine whether your frame is inertial except to look at whether you're accelerating relative to matter on some large scale. In Newton's time, they would have said "the fixed stars." Today, we would say the Hubble flow. Either way, it's an approximate and unsatisfactory notion. This is one reason why the relativistic definition of an inertial frame is superior.
The accepted answer by Dale is simply wrong. An accelerometer can't tell the difference between a gravitational field and an acceleration. That would violate the equivalence principle.
A: The best answer I know is based on the characterization of an inertial reference frame contained in section 3 of Landau&Lifshitz book on Mechanics: a reference frame is such that, if other bodies are far enough, the space is isotropic and homogeneous.
This formulation takes care of the asymptotic nature of inertial frames ("if other bodies are far enough") and, by referring to symmetry, contains the main ingredient characterizing inertial frames: their simplifying role in describing the world. Of course, the definition implicitly assumes the classical point of view that a reference frame is a "device" allowing measurements of space and time but with negligible interaction.
The precise way one may use to probe homogeneity and isotropy is left to the ability and capability of the experimentalist. Accelerometers, Foucault's pendulum, etc., are all possible tools. The essential concept is that the definition allows, at least in principle, to decide if one or the other friends (or both) are accelerating.
