Newton's First Law and Objects in momentary rest When an object is projected vertically up, its velocity at the highest point will be zero. But the net force is not zero, and is $mg$ vertically down where $m$ is the mass of the object and $g$ is the acceleration due to gravity.
When an object executes Simple Harmonic Motion (SHM), it's velocity is zero at its extreme positions. But the force is not zero. In fact it has the highest magnitude when the object is at either of the two extreme positions. This is because, the restoring force on an object executing SHM is given by $F=-kx$ where $k$ is the force constant and $x$ is the displacement from the mean position.
In the above two examples, even though the object is at momentary rest, the net force on it is not zero. We know from Newton's first law, that if the velocity of an object is constant, the net force on it is zero. But here it is not zero. 
Why is there a contradiction (First law says no net force even though the net force is non-zero) here? Or did I do any mistake here?
 A: The fact that the velocity is zero at one instant of time does not mean that the velocity is constant as the velocity will change in the next instant of time if there is a force.
Only if there is no force acting will the velocity will stay being zero.
A: You are wrong on assuming that zero velocity (like in the extrema of your system) means constant velocity. You can mantain a constant velocity of zero, or a constant velocity of $1\; km/s$ or have a non-constant velocity that in a certain instant values to zero (like in this case).
Force has to do with acceleration (the rate of change of velocity in time). Since there is a rate of change of velocity over time in your examples it means there is a force, even if at that instant the velocity is zero.
The first law still holds, since it states that the only possible way that something is in uniform rectilinear motion is to have a zero net force applied on it, both things are equivalent, so having a net force present means that it is not moving in uniform rectilinear motion, which it totally is the case.
