Suppose we have three systems made up of the same amount of the same substance, $S_1, S_2$ and $S_3$. They start with temperatures $T_1$, $T_2$, $T_3$ such that $T_1>T_2>T_3$.
We can place the systems next to each other along a line: $S_1 | S_2 |S_3$, where $|$ indicates that the systems on either side of it are in contact.
Let us assume that this line of systems, taken as a whole, can be treated as isolated. Within the line itself, however, heat and work may be exchanged between any two systems in contact. The three systems therefore begin to get into thermodynamic equilibrium with each other.
At the very start of the process, $S_1$ loses heat $\delta Q_{12}$ to $S_2$, and $S_2$ loses heat $\delta Q_{23}$ to $S_3$. The systems' entropies change by $dS_1$, $dS_2$ and $dS_3$ respectively.
I would like to show that $dS_1 + dS_2 + dS_3 > 0$, using the Clausius inequality. In other words, I would like to show that the Second Law of Thermodynamics has as a consequence that the entropy for the whole line of systems increases as the line reaches internal thermodynamic equilibrium.
The Clausius inequality automatically gives $d S_1 \geq \frac{-\delta Q_{12}}{T_2}$ and $d S_3 \geq \frac{\delta Q_{23}}{T_2}$, because $S_1$ and $S_3$ are both only in contact with $S_2$, which is at temperature $T_2$.
But can I use the Clausius inequality to complete my argument and say: $d S_2 \geq \frac{\delta Q_{12}}{T_1} + \frac{-\delta Q_{23}}{T_3}$? Can/how would the Clausius inequality can be applied when a system is in contact with two reservoirs of different temperatures?