Usually one proves $\rm\:g\:|\:ra+sb\:$ for all integers $\rm\:r,s\:$ (vs. all positive integers). From that we deduce that $\rm\:g\:|\:a,b\:$ by taking $\rm\:r,s = 1,0\:$ and $\,0,1.\:$ Revisit your proof: it probably works for all integers. Below is one conceptual way to present such a proof.
Hint $\ $ The set $\rm\:S\:$ of integers of the form $\rm\:x\:a + y\:b,\ x,y\in \mathbb Z\:$ is closed under subtraction so, by the Lemma below, every $\rm\:n\in S\:$ is divisible by the least positive $\rm\:d\in S.\:$ Thus $\rm\:a,b\in S\:$ $\Rightarrow$ $\rm\:d\:|\:a,b,\:$ i.e. $\rm\:d\:$ is a common divisor of $\rm\:a,b,\:$ necessarily greatest, by $\rm\:c\:|\:a,b\:$ $\Rightarrow$ $\rm\:c\:|\: \hat x\:a+\hat y\:b = d\:$ $\Rightarrow$ $\rm\:c\le d.$
Lemma $\ \ $ If a nonempty set of positive integers $\rm\: S\:$ satisfies $\rm\ n > m\ \in\ S \ \Rightarrow\ \: n-m\ \in\ S$
then every element of $\rm\:S\:$ is a multiple of the least element $\rm\:m_{\:1} \in S\:.$
Proof $\ \: $ If not there is a least nonmultiple $\rm\:n\in S,$ contra $\rm\:n-m_{\:1}\! \in S\:$ is a nonmultiple of $\rm\:m_{\:1}.\ \ $
Remark $\ $ This linear representation of the the gcd is known as the Bezout identity for the gcd. It need not hold true in all domains where gcds exist, e.g. in the domain $\rm\:D = \mathbb Q[x,y]\:$ of polynomials in $\rm\:x,y\:$ with rational coefficients we have $\rm\:gcd(x,y) = 1\:$ but there are no $\rm\:f(x,y),\: g(x,y)\in D\:$ such that $\rm\:x\:f(x,y) + y\:g(x,y) = 1;\:$ indeed, if so, then evaluating at $\rm\:x = 0 = y\:$ yields $\:0 = 1.$
The fundamental lemma, interpreted procedurally, yields Euclid's classical algorithm to compute the gcd using repeated subtraction.