Solving the congruence $7x + 3 = 1 \mod 31$? I am having a problem when the LHS has an addition function; if the question is just a multiple of $x$ it's fine.
But when I have questions like $3x+3$ or $4x+7$, I don't seem to get the right answer at the end.

By Gauss's algorithm $\bmod 31\!:\,\ 7x\equiv -2\iff x\equiv \dfrac{-2}7\equiv\dfrac{-8}{28}\equiv\dfrac{-39}{-3}\equiv \,\bbox[5px,border:1px solid #c00]{13}$

Or by Inverse Reciprocity
$\bmod 31\!:\,\ \dfrac{-2}{7}\equiv  \dfrac{-2-31\!\!\!\!\overbrace{\left[\dfrac{-2}{\color{}{31}}\bmod 7\right]}^{\large -2/3\,\equiv\,-9/3 \,\equiv\, \color{#c00}{-3\ }}}7\equiv\dfrac{-2-31[\color{#c00}{-3}]}7\equiv\dfrac{91}7\equiv\,\bbox[5px,border:1px solid #c00]{13}$

Or  by the forward extended Euclidean Algorithm (and its fractional form)
$\ \ \ \ \begin{array}{rr}
[\![1]\!]  &31\, x\,\equiv\ 0  \\
[\![2]\!]  &\ \color{#0a0}{7\,x\, \equiv -2}\!\!\!\\
[\![1]\!]-4\,[\![2]\!] \rightarrow [\![3]\!] &  3\,x\, \equiv\, 8 \\
[\![2]\!]-2\,[\![3]\!] \rightarrow [\![4]\!] & \bbox[5px,border:1px solid #c00]{x\, \equiv 13}\!\!\!\! 
\end{array}$
said multi-fractionally $\ \ \dfrac{0}{31}  \overset{\large\frown}\equiv \color{#0a0}{\dfrac{-2}7}  \overset{\large\frown}\equiv \dfrac{8}3 \overset{\large\frown}\equiv\,\bbox[5px,border:1px solid #c00]{\dfrac{13}1}\ $ $\ \leftarrow\ \text{easiest}\, {\textit general} \text{ method}$
