Yes, it moves forward as the speed increases. Its purpose is "to slow the flow of air from supersonic flight speed to a subsonic speed before it enters the engine."
From Wikipedia:
The air flow to the engine is regulated by an inlet cone in the air intake. On early model MiG-21s, the cone has three positions. For speeds up to Mach 1.5 the cone is fully retracted to the maximum aft position. For speeds between Mach 1.5 and Mach 1.9 the cone moves to the middle position. For speeds higher than Mach 1.9 the cone moves to the maximum forward position.
On the later model MiG-21PF, the intake cone moves to a position based on the actual speed. The cone position for a given speed is calculated by the UVD-2M system using air pressures from in front and behind the compressor of the engine. On both sides of the nose there are gills to supply the engine with more air while on the ground and during takeoff.
You can watch it move on YouTube.

(Source) The aforementioned gills.
Related: What are the merits of an inlet cone/spike/centerbody vs. a 2D inlet?