Line marked in red is what I don't understand . I feel that the restoring force acts only on the fluid of length l-2y ,whereas the solution says that the restoring force acts on the entire liquid .

The restoring force has to accelerate the entire length of fluid as a unit, so it's causing the fluid of length l - y (it's low by y in one arm and high in one arm by y, right?) to move back up and it's pushing the fluid of l + y down.

But isn't the restoring force like a pushing force on the column of length l-2y . In that case how can this force due to column length 2y exert force on itself ?

Its the earth that exerts force on the liquid as a whole. The net force from the earth to the whole liquid is 2yAρg for any displacement y from the equilibrium position. Thats because thats the "extra weight" of the liquid in one side of the U tube relative to the other, the other two weights of magnitute (l-y)Aρg are cancelled out.

Btw its a bit unclear the liquid has total length l or 2*l? It doesnt change anything in the analysis anyway just If its l then the height is l/2+y in one column and l/2-y in the other and the two weights that cancell out are (l/2-y)Aρg in this case.

Delta is right. It is gravity that exerts force on the whole liquid.
Let be the length of the whole liquid L.
See picture. The column of liquid in the right tube is y1 high and its mass is m_{1}.That in the left tube is y_{2} and its mass is m_{2}. The mass in the horizontal part is m_{3}. The forces on m_{1} are m_{1}g downward and the push N_{1} from m_{3} upward. The force on m_{2} is m_{2}g downward and N_{2} upward. (The normal forces are equal to the pressure at the interfaces multiplied by the cross section A. ) The horizontal part is pushed by N1 to the left and by N2 to the right. It can move only horizontally, its weight is balanced by force of the wall. The liquid is incompressible, it moves as a whole, with acceleration a. So ##N_1-m_1 g=m_1\ddot y_1 = -m_1 a## and ##N_2-m_2 g=m_2 \ddot y_2=m_2 a##, For the horizontal part, ##N_1-N_2= m_3 a##. Combine the equations : ##(m_1+m_2+m_3) a=(m_1-m2)g##, or ##La=(y_1-y_2) g##. If Δy is the displacement from the original level, ##y_1-y_2=2Δy##. ##2a=-(\ddot y_1-\ddot y_2)=-d^2(Δy)/dt^2##. The final equation is ##Ld^2(Δy)/dt^2+2gΔy=0##.

Well ehild gives a very good analysis, but i think a simple intuitive explanation maybe better: that the weights of the two equally lengthed (L/2-y) parts are not exactly cancelled out as i say in my first post, however they cannot change the kinetic state of the fluid because when we have two equally lengthed parts on the left and right side of the tube, we dont observe fluid motion.

This is not strictly true. There are internal forces due to pressure within the liquid. The entire external force that does work is gravity. The basic point is that the net force has to accelerate all of the liquid.

If familiar with the Lagrange or Hamilton formalisms, they are conceptually much simpler to use in this scenario.

How is normal force acting in horizontal direction on the horizontal part of the fluid ? Doesn't it act vertically upwards on the liquid in the vertical section of the tube ?

The name "normal force" was for analogy. It is pressure multiplied by the area of a surface/interface. The pressure does not have direction. The pressure times area is a force, perpendicular to the surface. At the same place, it is the same in any directions.

Well i ve to say that ehild's solution gives better understanding of the inner workings of this situation. Because just stating that the net restoring force due to gravity is - (2yAρ)g and that the weights from the two L/2-y parts "cancell out" is very intuitive and kind of vague. While for example if you follow ehilds' post from equation
##(m_1+m_2+m_3) a=(m_1-m2)g##,
one can understand clearly and formally why the two weights of m1 and m2 cancell out.