Here is another approach:
Suppose $y = 7 - 2x$
Let's examine the steps we take to get to $y$, starting with $x$.
1. First we multiply $x$ by $2$. Now we have $2x$.
2. Next we multiply by $-1$, so we have $-2x$.
3. Finally, we add $7$, so we have $7 - 2x$, and we have arrived at $y$.
To "undo" this, we do the "undoing" operation of each of our 3 steps, IN REVERSE ORDER.
First, we subtract $7$. this "undoes" the adding of $7$, so we have $y - 7$.
Next, we multiply by $-1$ (multiplying by $-1$ twice leaves us where we were originally, so multiplying by $-1$ "undoes itself"). This gives us $(-1)(y - 7) = -y - (-7) = -y + 7 = 7 - y$.
Finally, we multiply by $\frac{1}{2}$ which is what "undoes" multiplication by $2$:
$\frac{1}{2}(7 - y) = \dfrac{7-y}{2}$.
Since we "undid", everything we "did" to get from $x$ to $y$, we must now be back at $x$:
$x = \dfrac{7 - y}{2}$.
If we have $f(x) = 7 - 2x$, and $g(y) = \dfrac{7 - y}{2}$, as a final check, we verify that:
$g(f(x)) = x$, and $f(g(y)) = y$.
$g(f(x)) = \dfrac{7 - f(x)}{2} = \dfrac{7 - (7 - 2x)}{2} = \dfrac{7 - 7 + 2x}{2} = \dfrac{2x}{2} = x$
$f(g(y)) = 7 - 2(g(y)) = 7 - 2\left(\dfrac{7 - y}{2}\right) = 7 - (7 - y) = 7 - 7 + y = y$.