How does $dS = dQ/T$ define a state function $S$? In a thermodynamic process, entropy change from a state $a$ to $b$ is defined as $$ \int_{a}^{b}\frac{\delta Q_{rev}}{T}  $$
But, there can be infinitely many reversible paths to reach $b$ from $a$. In general, the heat transfer $\delta Q_{rev}$ will be different for different paths taken. How does the temperature in the denominator make the integral i.e. change in entropy a path independent quantity? 
I tried to find a necessary condition by imposing that change in entropy should be a path independent function as follows:
$$\Delta S =\int_{a}^{b}\frac{\delta Q_{rev}}{T} $$
$$\Delta S =\int_{a}^{b}\frac{ dU + \delta W}{T} $$
In terms of P and V,
$$= \int_{a}^{b}\frac{ dU + P dV}{T} $$
Let's consider a path $P(V)$ in P V diagram from $a$ to $b$.
Internal energy $U = U(P,V) = U(P(V),V)$
Temperature $T=T(P,V)=T(P(V),V)$
$$\Delta S= \int_{a}^{b}\frac{ dU(P,V) + P dV}{T(P,V)} = \int_{a}^{b}\frac{ \partial_P U(P,V) \frac{dP}{dV} dV + \partial_V U(P,V) dV + P dV}{T(P,V)}$$
Now if we perturb our path $P(V)$ to $P(V) + \delta P(V)$, keeping the end points fixed, $\Delta S$ should be the same. So the difference in $\Delta S$ should be zero i.e. $\delta (\Delta S)=0$
$$\delta (\Delta S) = \delta\int_{a}^{b}\frac{ dU(P,V) + P dV}{T(P,V)}  $$
(The math is going somewhat similar to the stationary action principle except that in the stationary action principle, we find the path having stationary action but here we are imposing the condition on every path)
Let $$\frac{ \partial_P U(P,V) \frac{dP}{dV}  + \partial_V U(P,V)  + P }{T(P,V)} = L(P,P',V)$$, where $P'= \frac{dP(V)}{dV}$
$$\delta (\Delta S) = \int_{a}^{b}\delta L(P,P',V) dV$$
Writing down the first order changes:
$$\delta (\Delta S) = \int_{a}^{b} \partial_P L(P,P',V)\delta P + \partial_{P'} L(P,P',V)\delta P'  dV$$
$$0= \int_{a}^{b} (\partial_P L(P,P',V) - \frac{d\partial_{P'} L(P,P',V)}{dV})\delta P + \frac{d}{dV}(\partial_{P'} L(P,P',V)\delta P) dV$$
The end points are fixed so the last term in the integral will be zero. And becasue it is true for any perturbation $\delta P$ so
$$\partial_P L(P,P',V) - \frac{d\partial_{P'} L(P,P',V)}{dV} = 0$$
This gives us
$$\partial_P (\frac{\partial_P U}{T}) P' + \partial_P(\frac{\partial_V U + P}{T})=\frac{d}{dV}(\frac{\partial_P U}{T})$$
$$\partial_P (\frac{\partial_P U}{T}) P' + \partial_P(\frac{\partial_V U + P}{T})=\partial_P(\frac{\partial_P U}{T}) P' + \partial_V(\frac{\partial_P U}{T})$$
$$\partial_P(\frac{\partial_V U + P}{T})=\partial_V(\frac{\partial_P U}{T})$$
Is the last equation correct? If yes then, is the last equation a result of Maxwell's relations?
 A: Your derivation is flawed from the beginning because a path being drawn in a $pV$-diagram is not actually enough information to say whether or not it represents a reversible or irreversible process, cf. this answer by Joshphysics, so it is not justified to claim that $\Delta S = \int \frac{\delta Q}{T}$ for any perturbation of a reversible path in a $pV$-diagram - equality might not hold. In other words, simple $pV$-space is not a faithful representation of the true thermodynamic equilibrium state space.
The standard way to show the state function property of $\Delta S$ is to show that $\Delta S = 0$ along any closed reversible cycle. By the well-known logic for conservative forces, this also implies path-independence and "state function-ness".
A: If the question is to show that the integral of $dQ_\text{rev}/T$ is path independent, here is one way:


*

*Start with the fact that $U$ is a function of two independent variables. We may write $U=U(P,V)$ but with a change of variables we can write $U=U(X,Y)$, in general. 

*Write the first law for reversible process 
$$dU = dQ_\text{rev} - P dV$$


*This equation gives the differential of $dU$ and clearly one of the independent variables is $V$. Then $dQ_\text{rtev}$ must represent the differential with respect to the missing variable $X$: $$dQ_\text{rev} = A dX$$
where $A$ is the partial derivative of $U(X,V)$ with respect to $X$.

*Define:
$$A \equiv \text{temperature},\quad X \equiv\text{entropy}$$
Then $dU = T dS - P dV$ from which we obtain
$$dS = \frac{dU}{T}+\frac{PdV}{T}$$ 
The last result states that $S=S(U,V)$. If we change variables and express internal energy and volume as a function of $P$ and $T$, i.e., $U=U(T,P)$, $V=V(T,P)$, then $S=S(T,P)$, which implies that the integral of $dS$ on the $(P,T)$ plane is independent of the path. Similarly for any other combination of independent variables. 

Comment 1 Why $A\equiv T$, $X \equiv S$, and not the other way around? 
Because the above definitions reproduce all known properties of entropy and temperature. The only result we cannot obtain from this derivation is the inequality $dS \geq T dS - p dV$. That's because we started with a reversible process, which makes the inequality an exact equality.
Comment 2 The derivation assumes a closed system. In general, $U=U(T,P,n_1,n_2,\cdots)$ but in a closed system all $n_i$ are constant so that we may treat $U$ as a function of only two independent variables. 
