Writing a Second Order Logic Sentence I want to express the following sentence in Second Order Logic :
"Every binary relation that is transitive, symmetric and reflexive is the identity relation"
But I am not sure how I should start.
How would I showcase a binary realtion in SOL ?
 A: $\forall R,S:[\forall a, b: (a,b)\in R \implies a\in S \land b\in S]\space$  ($R$ is a relation on set $S$)
$\land \forall a\in S: (a,a)\in R\space$  ($R$ is reflexive)
$\land \forall a, b\in S:[(a,b)\in R \implies (b,a)\in R]\space$  ($R$ is symmetric)
$\land \forall a,b,c\in S:[(a,b)\in R \land (b,c)\in R \implies (a,c)\in R]\space$  ($R$ is transitive)
$\implies \forall a,b:[(a,b)\in R \implies a=b]]\space$  ($R$ is the identity relation on $S$)
If you want to quantify over predicates instead, you can change $x\in S$ to $S(x)$ and $(x,y)\in R$ to $R(x,y).$
A: It sounds like you're a bit confused about second-order quantification. Remember that second order logic has, for each natural number $n$, built-in quantification over $n$-ary relations. This is usually denoted by "$\forall R^n$," although I've seen other notations. So you don't need to express $$\forall R(\mbox{if $R$ is a binary relation, then [stuff]}),$$ you can just write $$\forall R^2(\mbox{[stuff]})$$ directly; that quantifier ranges over exactly the binary relations.
The [stuff], here, should express: $$\mbox{"If $R$ is transitive, symmetric, and reflexive, then $R$ is the identity relation."}$$ You have to figure out how to express all this appropriately, so I haven't solved the problem for you. But this is really a first-order problem (how do you say that a given relation is transitive, symmetric, reflexive, or the identity?), and I suspect you can solve it without difficulty.

(If you want to be very formal about it, each second-order variable symbol in your language comes equipped with an arity, and you have infinitely many second-order variable symbols of each arity.)
