Addendum added to react to the discussion in the comments following this posting.
Either you are misinterpreting the intent of the assertion in the posting's title, or the assertion is false.
Counter example: $~n=10, k=5, a=1,b=11.~$
Here, you have that
- $ka \equiv kb \pmod{n}.$
- $a \equiv b \pmod{n}.$
- gcd$(k,n) \neq 1.$
So, the assertion in your point #2 is false, by the above counter-example.
Presumably, the assertion-composer's intent, was that if, every time that $~ka \equiv kb \pmod{n},~$ you also have that $~a \equiv b \pmod{n},~$ then you can conclude that gcd$(k,n) = 1.$
Another way of expressing the presumed intent, is that if gcd$(k,n) \neq 1,~$ then you can find some $~a,b~$ such that $~ka \equiv kb \pmod{n},~$ and $~a \not\equiv b \pmod{n}.$
$\underline{\text{Addendum}}$
Reaction to the discussion in the comments following this posting. Consider the posting's title:
Show that $ka \equiv kb \pmod{n}$ implies $a \equiv b \pmod{n}$ if and only if $\gcd(k,n) = 1$.
This ambiguous assertion can be interpreted in two different ways:
Show that $ka \equiv kb \pmod{n} \implies$
$\{ ~a \equiv b \pmod{n} \iff \gcd(k,n) = 1 ~\}.$
Show that $\{ ~ka \equiv kb \pmod{n} \implies a \equiv b \pmod{n} ~\}$
$\iff \gcd(k,n) = 1.$
That is, the syntax in the title makes it unclear how the logical sub-statements are to be bracketed. The bracketing in the first bullet point above leads to a false assertion, as indicated by the counter example at the start of my posting.
The bracketing in the second bullet point above leads to a true assertion. In order to analyze the assertion in the second bullet point, let
- P denote the statement $~ka \equiv kb \pmod{n}.$
- Q denote the statement $~a \equiv b \pmod{n}.$
- R denote the statement $~\gcd(k,n) = 1.$
Then the assertion in the second bullet point above can be represented as
$$[P \implies Q] \iff R. \tag 1 $$
The way that I interpret (1) above is that
if it is impossible to have [ (P true and Q false)]
then [R true].
Note that this is equivalent to asserting that
[R false] implies
it is possible to have [ (P true and Q false)].
if [R true] then
it is impossible to have [ (P true and Q false)].