Is this a valid way of solving modular equations? Some of the exercises in my abstract algebra textbook involve solving congruence equations, for example $$5x \equiv 1 \pmod 6$$
I convert that to a linear equation by rewriting $$x = \frac{k6+1}{5} = k + \frac{k+1}{5}$$ The solution for $k$ is obvious, and an x comes up pretty quick. 
Since I only have the book, I was wondering if this is a valid method of solving these types of equations, i.e. are there any flaws to it. Thanks
 A: What you want to do is find the inverse of $5$ modulo $6$. Modulo $6$ there are only $6$ elements, namely the equivalence classes of $0,1,2,3,4$ and $5$. In this case since $6$ is such a small number you can just try them out and notice that $5 \cdot 5 = 25 \equiv 1 \pmod 6$ so that $5x \equiv 1$ implies $5 \cdot 5x \equiv 5$, hence $x \equiv 5 \pmod 6$ is the unique solution to this equation. 
In general, to solve a linear equation of the type $ax \equiv b \pmod c$, you want to find $k \in \mathbb Z$ such that $ax - b = kc$, which means $ax - kc = b$. This is a question which is easily answered by the Euclidean algorithm ; feel free to google about that, the information is out there. This algorithm is well-documented. 
Hope that helps,
A: we have $$x\equiv \frac{1}{5}\equiv \frac{-5}{5}\equiv -1\equiv 5\mod 6$$
A: That is completely fine. As you noticed $5x \equiv 1\; (\operatorname{mod} 6)$ is equivalent to $\exists k \in \mathbb{Z}$ s.t. $5x - 1 = 6k$. Since these are logically equivalent, you will neither introduce extraneous solutions nor lose valid ones.
A: $5x \equiv 1 \pmod{6} \iff 6 \mid 5x -1$ and so there is an integer $k$ such that $6k = 5x - 1$ and so $5x =6k + 1 \implies x = \frac{6k+1}{5}$. This is completely right as long as you know which integer variable satisfies the equation $$6k = 5x-1$$
