The actual proof of $\delta W = P dV$ All "proofs" of $\,\delta W = P dV\,$ that I saw involve some piston and a gas cylinder. But how to prove this is true in general, that whenever (or maybe under some necessary conditions) we apply the first law of thermodynamics, we can substitute $PdV$ for $\delta W$.
Edit: I would also like to remind that $\,\delta W = P dV\,$ holds for reversible processes only. So the answer must use this assumption. P is the pressure of a gas.
 A: For a general material volume $V$, you can write the power of surface force acting on its contour $\partial V$ can be written as
$\dot{W} = \displaystyle \oint_{\partial V} \mathbf{t}_n \cdot \mathbf{u}$.
For a fluid with negligible viscous stress (either negligible viscosity or quasi-static conditions, as those often considered in thermodynamics), $\mathbf{t}_n = - P \mathbf{\hat{n}}$, so that
$\dot{W} = - \displaystyle \oint_{\partial V} P \mathbf{\hat{n}} \cdot \mathbf{u}$.
In quasi-static conditions, we can assume that the pressure is uniform throughout the volume $V$ and in all points of its surface $\partial V$, so that we can take $P$ outside the integral
$\dot{W} = - P \displaystyle \oint_{\partial V} \mathbf{\hat{n}} \cdot \mathbf{u}$.
The last step tells you the meaning of the integral. Using Reynolds' transport theorem for the constant function $f(\mathbf{r}) = 1$, we get
$\displaystyle
 \dfrac{d V}{dt} = \dfrac{d}{dt} \int_V 1 \ dV =
 \dfrac{d}{dt} \int_V f(\mathbf{r}) dV = \int_V \underbrace{\dfrac{\partial f}{\partial t}}_{=0 \text{ since $f(\mathbf{r}) = 1$}} dV + \oint_{\partial V} \mathbf{u} \cdot \mathbf{\hat{n}} = \oint_{\partial V} \mathbf{u} \cdot \mathbf{\hat{n}}$,
i.e. the integral term above is the time derivative of the volume $V$. Putting everything together, recalling that the power $\dot{W}$ is the time derivative of the work $W$, we get
$\dfrac{d W}{dt} = - P \dfrac{d V}{d t}$,
whose incremental expression reads
$\delta W = - P \delta V$. Minus sign comes since this is the work of forces acting on the system, and not the work done by the system: change sign to get the result you need.
A: Define a volume $V$ under pressure $P$. The total differential work done in a differential process, $\delta W$, is that pressure times the perpendicular movement of the 6 faces of the cube. This will be $dV$. Any valid coordinate transformation will not change that result, it will just change the form of the $dV$ by a Jacobian.
Note that convention matters. This is $\delta W_{out}$, not $\delta W_{in}$. Using work out is customary in thermodynamics for engines and such, so $dE = \delta Q_{in} - \delta W_{out} = \delta Q_{in} - PdV$. If you had said $dE = \delta Q_{in} + \delta W_{in}$, you would still negate the $PdV$ term.
Please note that this problem is a notational nightmare. If you want to study a differential volume, it is natural to call it $dV$, but then, what do you call the change in volume? My initial answer called the volume $dV$, but this then confuses the "other" $dV$, which is the change in the volume. However, you can view it for any finite volume $V$ and imagine that volume going to zero, and that probably is enough precision for you. Otherwise, I will refer you to the calculus of moving surfaces, which is the proper mathematical formalism for this sort of thing. It is pretty difficult, though. I would recommend a book entitled Tensor Analysis and the Calculus of Moving Surfaces by Pavel Grinfeld if you are interested in going deeper. It is one of the best I have seen, and the treatment of tensors is incredibly elegant.
It is worth noting that "the piston" you always see as the example is a very simple application of the calculus of moving surfaces.
A: IMO the answer by @Steeven is the most direct one. So the purpose of this answer is to support his.
The expression for work can be shown in various forms. The most basic is force times displacement. But force times displacement can take many additional forms.
In thermodynamics, for a closed system, $PdV$ work is what we call "boundary work". It is the work that either expands or contracts the boundary between the system and its surroundings. So instead of a force causing the linear displacement of an object, boundary work is pressure causing an increase or decrease in the volume of the system. Mathematically, that works out to be the same thing, as @Steeven has shown.
Another form of work involves torque times angular displacement. Again, mathematically, it can be shown it is the same thing as force times displacement.

Edit: I would also like to remind that $\,\delta W = P dV\,$ holds for reversible processes only. So the answer must use this
assumption

That is not correct. For any process, reversible or irreversible, the pressure $P$ in $PdV$ is always the external pressure. If (and only if) the process is reversible, then $P$ in $PdV$ is also the pressure of the gas which, for a reversible process, is always in equilibrium with the external pressure.
Hope this helps.
A: $$\delta W=F\delta x=F\frac{\delta V}A=\frac FA\delta V=P\delta V$$
