An inertial frame of reference observes an object on which the total force is zero but still has non-zero acceleration Imagine a cup stuck to the floor of a falling elevator with the help of some impressive adhesive. In a frame of reference is this cup is being watched through the walls of a transparent elevator, this frame of reference is not accelerating with respect to earth. Now, since earth is an inertial frame of reference, and since this frame of reference is not accelerating with respect to it then it must be the case that this frame of reference in which the cup is viewed is also an inertial frame of reference.
Let's call this frame of reference viewing the cup S since S is an inertial frame of reference, it must follow the law:
$$a=0 \iff F=0 \ \text {(Newtons First Law)} \tag 1$$
but it doesn't, here's why:
The force on the cup is the tension force due to the adhesive and the force due to the Earth, the reaction force, all add up to zero because the cup is seen to not accelerate within the lift.
Okay the so the cup has zero forces acting on it from the observer, the tension force, the gravitational force, the reaction force, all add up to zero. Since S is an inertial frame of reference and $F=0$, the acceleration must be zero from 1. But according to S it isn't, it is accelerating with $9.8\ \text{m}/\text{s}^2$.
In conclusion:
An inertial frame of reference observes an object on which the total force is zero but still has non-zero acceleration. How can this contradiction be resolved?
 A: $$\pmb {\underline {\text { Newtonian Picture}}}$$
The problem is in this statement 

the tension force, the gravitational force, the reaction force, all add up to zero

Actually the only force acting on the cup is gravitational force and hence in your "inertial reference frame" the cup is seen to be accelerating downward due to a real force. So there is no contradiction.
Why so? Because :


*

*Glue force acts as friction over here and hence doesn't occur in the absence of relative motion. 

*Normal Reaction acts when two bodies try to occupy the same space. But as you may notice that since the cup is just hovering over the surface i.e., it doesn't apply any force to penetrate it and so neither the normal reaction occurs.

An interesting thought experiment related to it is that of a freely falling man/woman falling in a lift with a cup in his/her hand. Guess what? When the man/woman leaves the cup while he/she is in free fall he finds that the cup just floats in front of him/her indicating that the cup even if put on the surface of the lift won't press it! 
A: The answer by @Johan Liebert gives the Newtonian analysis, so this answer will give the general relativistic analysis (note, in comments the OP later clarified that he/she is interested in the Newtonian analysis, so this is not directly relevant to his/her question but I left it for others who may have a similar question about the relativistic analysis):
In general relativity an inertial reference frame is characterized by the fact that accelerometers at rest anywhere in the frame read zero. In the falling elevator the accelerometers read 0, so the elevator is considered to be an inertial frame. 
In contrast, accelerometers attached to the ground read 1 g upwards, so the earth is a non-inertial frame. This frame is characterized by a 1 g fictitious or inertial force directed downwards. 
The adhesive provides 0 real force. The elevator and cup fall together naturally without additional force. 
So, in the inertial elevator frame there is 0 real force and therefore 0 net force and 0 acceleration, as observed. 
In contrast, in the non-inertial ground frame there is a 0 real force and a -mg inertial force. Therefore, in this frame there is a net force downwards and the cup accelerates downwards at g, as observed. 
A: You write:

Now, since earth is an inertial frame of reference, and since this frame of reference is not accelerating with respect to it then it must be the case that this frame of reference in which the cup is viewed is also an inertial frame of reference.

This is very confusing! To say the least.
The coffee in the cup, stuck to the floor simply starts to come out of it, if the coffee has been stirred (or shaken) and ignoring adhesive forces. Can't you see?
Then, as can be seen above, you write:

earth is an inertial frame of reference

How can Earth be an inertial frame of reference? The Earth is...well...the earth! It can find itself in an inertial frame (outer space). But that isn't true either. The Earth always finds itself in is own non-inertial frame of reference.
In the non-relativistic case, the falling cabin with the coffeecup attached will freely fall to Earth. So? The coffee will still do the same thing (when in motion and ignoring adhesivity) when viewing it from another co-falling cabin with glass, so you can look at the coffee.
And it has to be like this because Newtonian gravity is the limit of GR.
