Why don't forces on two surfaces of a fluid need to balance?

In my textbook (Resnick Halliday Krane), the derivation for pressure in a fluid at a given depth is done assuming that the fluid is homogeneous. Thus, the book concludes that the pressure in a fluid is the same at all levels given that the fluid is homogeneous and not otherwise. I had two problems with this:

1. Consider a vessel in the following shape, with two different area of cross-section. I know, from experience, that the level of water must be the same in the two arms. Indeed, that is necessary if the pressure is to be the same at the points $A$ and $B$ at the same level. But if we consider the situation in the following manner, there is a contradiction. Consider the whole volume of fluid between $A$ and $B$ in the tube as the fluid element.

As the pressure at $A$ and $B$ is the same ($p$, say), the force exerted by the fluid above $A$ on our fluid element will be $pA_A$ where $A_A$ is the cross-sectional area of the larger arm. Likewise, the force exerted by the fluid above $B$ on the fluid element will be $pA_B$ where $A_B$ is the cross-sectional area of the smaller arm.

But clearly, $pA_A > pA_B$ since the areas are different. How is the fluid then in equilibrium?

As pointed out in the comments below by LDC3, this setup is similar to that of a hydraulic press. So the question may be rephrased: if we put a large weight on one arm of the hydraulic press (the one with the larger area), and a small weight on the other (the one with the smaller area), why does the fluid in the press stay in equilibrium? There are clearly two unbalanced forces acting on it.

2. The book also presents the following argument to prove that for the pressure to be the same at two points in a fluid, the fluid must be homogeneous. Consider a typical u-tube but filled with three fluids of different densities. The densities are of the order: blue > green > red. Now, the book says that as the fluid is in equilibrium the pressure at the interface (of red and blue fluids and green and blue fluids) must be equal in both arms. Thus the pressure exerted by the column of red fluid equals the pressure exerted by the column of green fluid (the heights are different as the densities of the fluids vary).

Now, consider two points at the same level. One point is in the green fluid and one point in the red fluid. Thus the points are not in the same fluid. Also, since the height of the two points is the same above the interface, but the densities are different, the drop in pressure from the interface to $A$ is less than the drop in pressure from the interface to $B$. Thus the pressure is different at $A$ and $B$.

But if we again consider the fluid between $A$ and $B$ as the fluid element, we may follow a similar argument as in the previous point to arrive at a contradiction. The cross-sectional area of the two arms is the same ($A$, say). Thus the force exerted by the fluid above $A$ on the fluid element is $p_AA$ where $p_A$ is the pressure at $A$. Likewise, the force exerted by the fluid above $B$ on the fluid element is $p_BA$, where $p_B$ is the pressure at $B$.

But $p_AA < p_BA$. How is the fluid then in equilibrium?

Take A to be a cylindrical fluid element of height $h_A$ and cross sectional area $A_A$, as the entire portion of the fluid above the section marked $A$.

Take B to be another cylindrical element of the height $h_B$, with cross sectional area $A_B$, as the entire portion of the fluid about the section marked $B$.

As you have noticed, if the sections marked A and B are at the same level, then $h_A = h_B = h$ Assuming the density of the fluid is $\rho$, the weight of the elements is:

$$W_A = \rho A_Ahg \\ W_B = \rho A_Bhg$$

Since both elements are in equilibrium, the force due to the pressure from the fluid under them should be equal to their respective weights

$$\rho A_A h g = p_AA_A \\ \therefore p_A = \rho h g\\ \rho A_B h g = p_b A_B \\ \therefore p_b = \rho h g \\ \bbox[5px,border: 1pt solid black]{\therefore p_A = p_b}$$

The error in your reasoning is this: The forces on both the fluid elements do not need to be equal to each other. For an element to be in equilibrium requires only that the forces acting on that element add up to zero. Both elements are individually in equilibrium.

If you consider the portion of the fluid I've colored blue to be your element, your error lies in forgetting to consider reaction forces between the element and the bottom of the vessel in your free-body diagram. As it happens, the weight of the element plus any fluid elements above it will be balanced by the normal reaction between the fluid and the vessel.

Your mistake is assuming that the interfaces of the blue liquid must be at the same level on the left and the right: that would only be true if they faced the same pressure from above. But on the left the blue liquid is supporting column A; at the bottom of A there must be a certain pressure to support the liquid. At B, a similar thing happens.

Assuming for a moment that the red liquid has density $\rho_1$, the blue liquid density $\rho_3$, and the green liquid density $\rho_2$, then the equilibrium situation must look like this (cartoon, not to scale): Nothing is level...

Pressure equilibrium simply says that the pressure at the top of A is the same as the pressure at the top of B (atmospheric). Now let's make our way down column A:

Pressure increases in proportion to the total weight of the column being supported, so measuring from the top (call that P=0), it increases by $a\rho_1 g$. This should be the same pressure as is present at that level in the other arm, i.e. $b\rho_2g + d\rho_3 g$. We can now compute the values of $c$ and $d$ if the other quantities are given. Leaving out $g$:

$$a\rho_1 = b\rho_2 + d\rho_3\\ b+c+d=a\\ \text{so}\\ d = \frac{a\rho_1 - b\rho_2}{\rho_3}\\ \text{and}\\ c = a - b - d$$

Obviously, if you replaced the red and green fluids with weights, and the interface with pistons, you would simply have a hydraulic system; and when the mass per unit area on the pistons is different, a pressure difference will drive the working fluid in one direction until the column supports the difference, or some other additional force comes into play.