Your first proof seems to be wrong. Why does $k \notin \mathbb Z$? Your second proof seems to be correct, although if someone seriously wants a proof of the non-surjectivity of $f$, perhaps they want more detail.
As for the difference between proofs by counterexample and proofs by contradiction: there is no way to answer this question exactly without making precise by what you mean by a proof by counterexample, and what you mean by "different techniques", but I interpret it as something like this:
Let $P$ be some property. You are asked to prove $\neg\forall x P(x)$. A proof by counterexample constructs some $c$, and then proves $\neg P(c)$, effectively proving $\exists x \neg P(x)$. A proof by contradiction assumes $\forall xP(x)$ and then derives a contradiction.
In classical mathematics, these results are easily seen to be equivalent. However, if we move to constructive mathematics, then in fact these two are not equivalent; it is possible that you are able to prove $\neg \forall x P(x)$ without being able to prove $\exists x\neg P(x)$. This suggests that (even in classical mathematics) these are not quite the same proof technique, because by just slightly weakening what kind of argument we allow, the conclusion of one does not follow from the conclusion of the other.