Why does a massless, frictionless piston move from high pressure to low pressure? Consider an ideal gas kept in a rigid cylinder with a movable massless, frictionless piston at the top. Let the pressure inside the cylinder be $P$ at pressure exerted by the surrounding on the cylinder be $p$. Let $$ P>p $$
Now since the piston is massless net force on it must be 0 (since $m=0$). This implies that the piston can  move with any acceleration. But it moves in only one direction that is outwards. Why doesn't it moves inwards?

 A: A massless piston is really a shortcut for saying a piston whose mass is so small that it can be ignored for the purposes of the problem.  As Mark H points out, there are strict limits on what forces can be applied to a massless object.
If you want to have fun and make a true massless piston, you can do so by defining its properties carefully.  You can define it as follows:


*

*The massless piston remains motionless unless acted on.

*The massless piston is "captured" by exactly one particle.  "Captured" is not a normal physics term, so I will define its behavior exactly.

*When a particle reaches the edge of the piston, the piston applies no force to the particle.  Instead, it move up (or down) to remain in contact with the particle as it continue along its free path, and the piston is considered to be "captured" by the particle.

*If the piston is "captured," and a faster particle hits it from the same direction, the piston is released from the original particle and captured by the new particle.

*If the piston is "captured" by a particle and a particle hits it from the other side, it causes the two particles to act as though an elastic collision occurs between them.  The piston remains captured by the slower particle.


By defining this concept of capturing, we can create a massless object that interacts in a way that's similar to a real massive piston.  It acts as a sort of "broker," causing elastic collisions to occur between particles on opposite sides of the piston.
In the real world, the energy and momentum of these collisions is brokered through the mass of the piston.  The heavier the piston is, the more these collisions are averaged out and we can think of them as "pressures."  As the piston gets lighter, its going to flutter more due to random luck in the collisions.  The way I defined the massless piston above is basically an extreme flutter, where every single particle collision moves the piston until a collision in the opposite way stops it.
Again, this concept of "capturing" the piston is not standard physics.  In standard physics, you wouldn't have a massless piston like this.  It's merely a way to think about what a massless piston could do.
A: In order for the thought experiment to make sense, massless objects must never be subject to unbalanced forces. Otherwise, it would have an undefined acceleration $a=F/m$ where $F$ is a non-zero force and $m$ is a zero mass.
In your picture, the piston looks to be pressed against the lip of the pressurized chamber, so it is not moving and all is well. You can't analyze the motion of the piston without giving it mass. A massless piston can only be used for static situations.
A: The bigger force wins. 
Pressure is force per area. Let's calculate the forces:
$$F_{inside} =PA\qquad\text{and} \qquad F_{outside} =pA$$
The push from the inside is larger than from the outside, $F_{inside} >F_{outside}$. Easily seen since the areas are equal. 
The bigger force wins. The piston moves outward. 

Now since the piston is massless net force on it must be 0 (since m=0m=0). This implies that the piston can move with any acceleration

Thus might just be word mess-up. That the piston is massless does not mean that the net force on it is zero. It just means that it will move with enormous acceleration at any tiny net force.  
A: If you had a massless, frictionless piston, it would oscillate infinitely fast. There will be an outward force initially, so it will accelerate outward (acceleration = infinity).
I'm not entirely sure how you have deduced that the force is 0. I'm quite sure it is not, if the pressures are different.
A: Piston being massless never makes sense because it is the same as talking about thin air. 
Massless in the context that any force due to the elastic collisions between the particles and the piston can move the piston, i.e. the piston is maneuverable. 
