This part is pretty intuitive. Let $x_0$ be the integer to encode, then for any $1$ digit in the binary representation of $x_0$ you should apply an $X$ gate to its corresponding qubit. E.g, let $x_0 = 11$ (decimal value), then its binary representation is $1011$, and it can be encoded into 4 qubits as follows (using little-endian convention):
That part is a little more complicated. What I would recommend is comparing qubit-by-qubit using a negated $XOR$ operation into auxiliary qubits, followed by an $MCX$ with all the auxiliary qubits as control qubits. The $XOR$ operation writes $|1\rangle$ to the auxiliary qubit when the 2 compared qubits are unequal, then by negating the auxiliary qubit we ensure that $|1\rangle$ is written to the auxiliary qubit when the 2 compared qubits are equal in value. The $XOR$ operation is implemented using a $CNOT$ gate from each compared qubit to the auxliairy qubit. E.g when comparing 2 integers of 2-bits length each, it looks like this:
$|1\rangle$ would be written into the result qubit if and only if $number\_1$ and $number\_2$ are equal.
In addition, I have published an open-source software lately that synthesizes cricuits for satisfiability problems - it is capable of easily handling comparison and arithmetic operations like these discussed here - it might help you. It is available as sat-circuits-engine on GitHub, and in the demos page you might find already executed demonstrations.
Let me know if you need anything more.