How can we prove the inequality TdS > dU + pdV? I know that for reversible process
$$T\,\mathrm dS = \mathrm dU + p\,\mathrm dV,$$
but since all the terms in the given equation are state variables so the above equation should also be true for irreversible processes but in my textbook for irreversible process the inequality is used for irreversible process.
For a closed system with a single phase of a pure substance, when only expansion work is possible
$$\mathrm dU= -\mathrm p\,\mathrm dV + T\,\mathrm dS, \label{eqn:1}\tag{1}$$
where $p$ (the state variable) is the internal pressure and $T$ (the state variable) is the internal temperature of the system.
The first law, however, says more generally that
$$\mathrm dU = \mathrm dw + \mathrm dq. \label{eqn:2}\tag{2}$$
Equation \eqref{eqn:2} was derived by applying equation \eqref{eqn:1} to a reversible process.
For the reversible process, thermal and mechanical equilibrium between internal and external pressure means that $p_\mathrm{ext} = p$ and $T_\mathrm{ext} = T,$ and, combined with the second law, that
$$\mathrm dw = -p_\mathrm{ext}\,\mathrm dV = -p\,\mathrm dV \tag{3}$$
and
$$\mathrm dq = -T_\mathrm{ext}\,\mathrm dS_\mathrm{ext} = T\,\mathrm dS. \tag{4}$$
More generally, the second law says that
$$\mathrm dS_\mathrm{tot} = \mathrm dS_\mathrm{sys} + \mathrm dS_{surr} \ge 0 \tag{5}$$
the equality holding for a reversible process. Dropping the label for the system
$$\mathrm dS \ge -\mathrm dS_\mathrm{surr} \quad\leftrightarrow\quad \mathrm dS \ge \frac{\mathrm dq}{T_\mathrm{surr}}. \tag{6}$$
Therefore for an isothermal process (thermal equilibrium condition applies)
$$\mathrm dS \ge \frac{\mathrm dq}{T}. \tag{7}$$
The inequality applies for instance to an isothermal free expansion.