Clausius inequality leading to absurd result Background: After deriving Clausius inequality, the author of this book derives the following relation:
Consider the cycle shown in the figure in which leg $A \rightarrow B$ is irreversible. In the equation
$$
0>\oint\frac{\mathrm{d}Q}{T}=\int_{A \operatorname{irrev}}^{B} \frac{\mathrm{d}Q}{T}+ \int_{B \operatorname{rev}}^{A} \frac{\mathrm{d}Q}{T}
$$
the second term on the right-hand side of this equation is given by $S(A)-S(B)$ because it is taken over a reversible path. When we move this quantity to the left-hand side, we find that
$$
S(B)-S(A)>\int_{A \operatorname{irrev}}^{B} \frac{\mathrm{d} Q}{T}.
$$
Thus the difference in entropy between the points is greater than the integral of $\mathrm{d} Q / T$ over an irreversible change.

Problem: Entropy is a state function so $\int_{A \operatorname{irrev}}^{B} \frac{\mathrm{d} Q}{T}= {\Delta} S. $ By the inequality derived we have ${\Delta} S>{\Delta} S$ which is absurd.
 A: Considering the result $$\int_{A \operatorname{irrev}}^{B} \frac{\mathrm{d} Q}{T}<S(B)-S(A)$$ for an infinitesimal path, we get $$\mathrm{d}S\ge\frac{\mathrm{d}Q}{T}$$ where the equality holds only for a reversible process (by the definition of entropy).
This means that in your expression $$\int_{A \operatorname{irrev}}^{B} \frac{\mathrm{d} Q}{T},$$ $\frac{\mathrm{d} Q}{T}$ is not equal to $\mathrm{d}S$ because the process is irreversible. Instead, you have $\frac{\mathrm{d} Q}{T}<\mathrm{d}S$ and so $$\int_{A \operatorname{irrev}}^{B} \frac{\mathrm{d} Q}{T}<\int_{A \operatorname{irrev}}^{B} \mathrm{d}S=S(B)-S(A)$$ which is the original result.
A: For the irreversible path between the same two end states, dQ is different than dQ for the reversible path, and in the integral of dQ/T for the irreversible path, you are supposed to use the temperature at the boundary interface between the system and surroundings $T_B$.  So for the irreversible path, you should be using $$\int{\frac{dQ_{irrev}}{T_B}}$$So the two integrals are nothing like one-another.  The correct form of the inequality should read:  $$\Delta S\geq \int{\frac{dQ_{irrev}}{T_B}}$$
A: I find the following from Enrico Fermi's book to be the most explicit derivation that shows:
$$dS \geq \frac{dQ}{T}$$
Looking at a closed loop integral of the ratio of heat absorbed (or surrendered, depending on sign) to the heat bath temperature along each isotherm in a cycle (reversible or not),
$$\oint \frac{dQ}{T}=\int_{A}^{B} \frac{dQ}{T}+\int_{B}^{A}\frac{dQ}{T} \leq0$$
We can take the forward part of the cycle $(A\rightarrow B)$ as an irreversible transformation, and the return part of the cycle $(B\rightarrow A)$ as a reversible transformation. It is valid to do this because even irreversible cycles behave the same along the forward part of the cycle. We are just saying that as a limiting case, our cycle behaves reversibly along the return path:
$$(TdS=dQ)_{B \rightarrow A}$$
Therefore,
$$\int_{B}^{A}dS=\int_{B}^{A}\frac{dQ}{T}=S(A)-S(B)$$
$$\int_{A}^{B}\frac{dQ}{T} + S(A)-S(B) = \int_{A}^{B}\frac{dQ}{T}-[S(B)-S(A)]  \leq 0$$
Conversely,
$$S(B)-S(A) \geq \int_{A}^{B}\frac{dQ}{T}$$
$$dS \geq \frac{dQ}{T} $$
