If $x$ is irrational then $3x+2$ is irrational.
My Working:
Proof by contraposition:
$3x + 2$ is rational and $x$ is rational
$x = a/b$
$y = c/d$
$3x + 2 = c/d$
$3x = (c/d) - 2$
$x = c-2d/3d$
$a/b = c-2d / 3d$
I am having a hard time understanding as to why do we end up solving for $x$ in this equation to determine weather $3x+2$ is rational or not if $x$ is rational.
What you have is not a proof by contraposition.
If you were actually proving the contrapositive directly, you would not assume that $x$ is rational: you would assume that $3x+2$ is rational and show that this implies that $x$ is rational. Such a proof would start something like this:
In order to show that $x$ is rational, you’re going to have to solve for it in terms of $a$ and $b$ in order to express it as a ratio of integers.