You are partially right.Not necessarily. Bezout's identity also mentioned, "more generally, the integers of the form $$ n=ax + by$$ are exactly the multiples of $d$."
This implies if $\gcd(x,y)=d'$, then $n$ is also a multiple of $d'$.
Therefore,
$$n=ax+by=\gcd(a,b)\gcd(x,y)n'$$
Suppose that $a$ and $b$ are integers. We want to prove that $\gcd(a,b)=1$ if and only if there exists integers $x$ and $y$ verifying $ax+by=1$.
We are going to start by proving the $\Leftarrow$ which is the easiest.
Assume you have a common positive divisor $d$ of $a$ and $b$.
$d$ divides $ax$ and $ay$ and by extension $ax+by$. Meaning $d$ divides $1$, $d=1$ (remember we assumed it to be positive so it can't be equal to $-1$)
The previous line of reasoning proves that there is only one common postive divisor of $a$ and $b$ which is 1. Hence, $\gcd(a, b)=1$.
Now time for the $\Rightarrow$.
We are going to consider the set of nonzero positive linear combination with integer coefficients, take the smallest element and prove it equal to 1.
Namely, $$A=\left\{ax+by |x,y \in \mathbb{Z}\text{ and }ax+by>0 \right \}$$
This set is nonempty. You can prove this by choosing (x,y) as one of these (depending on $a$, $b$ signs) : $$(±1,0), (0,±1)$$
The set $A$ is a subset of $\mathbb{N^*}$.
Ergo, we assert the existence of a smallest element $d=\min A$.
By definition, we can find $x_0,y_0$ integers such that
$$\begin{equation}
ax_0+by_0=d \tag{*} \label{eq:*}
\end{equation} $$
If we prove that $d$ divides both $a$ and $b$, then $d=1$ (because $1$ is the gcd). So let's do that:
Suppose $d$ does not divide $a$, by Euclidean Division theorem we can find an interger $q$ and positive non zero integer $d$ such that:
$$a = dq + r$$
$$0<r<d$$
Using $\eqref{eq:*}$, we find $$r =a - q(ax_0+by_0)=(1-qx_0)a+b\times (-y_0)$$
This contradicts the minimality of d, and thus we conclude that $d$ divides $a$. By similar logic we can prove that $d$ divides $b$.
And we find our desired formla, $$ax_0+by_0=1$$
This is my first post in math stack exchange, so excuse the novice layout :(
Best Answer
Let $a,b$ be odd, relatively prime integers.
Claim: In $Z[i]$, the elements $$c + di\;\;\text{and}\;\;c - di$$ are relatively prime, where $$c = \frac{b+a}{2}\;\;\text{and}\;\;d=\frac{b-a}{2}$$ Note that any integer common factor of $c$ and $d$ would divide $c+d$ and $c-d$, hence would divide $a$ and $b$.
It follows that $\gcd(c,d) = 1$.
Also, since $a,b$ are odd, one of $c,d$ is odd, the other even, hence $c^2+d^2$ is odd.
Suppose that in $\mathbb{Z}[i]$, the element $s$ is a common factor of $c + di\;$and$\;c-di$.
The goal is to show that $s$ is a unit of $\mathbb{Z}[i]$.
In the steps below, the divisibility symbol means divisibility in $\mathbb{Z}$ provided the expressions on both sides of the symbol are necessarily integers; otherwise it means divisibility in $\mathbb{Z}[i]$.
\begin{align*} \text{Then}\;\;&s \mid (c + di)\\[4pt] \implies\;&|s|^2 \mid (c^2 + d^2)\\[4pt] \implies\;&|s|^2\;\text{is odd}&&\text{[since $c^2 + d^2$ is odd]}\\[12pt] \text{Also}\;\;&s \mid (c+di)\;\;\text{and}\;\;s \mid (c-di)\\[4pt] \implies\;&s\mid \bigl((c+di) + (c-di)\bigr)\\[0pt] &\;\;\text{and}\\[0pt] &s\mid \bigl((c+di) - (c-di)\bigr)\\[4pt] \implies\;&s \mid (2c)\;\;\text{and}\;\;s \mid (2di)\\[4pt] \implies\;&|s|^2 \mid (4c^2)\;\;\text{and}\;\;|s|^2 \mid (4d^2)\\[4pt] \implies\;&|s|^2 \mid c^2\;\;\text{and}\;\;|s|^2 \mid d^2&&\text{[since $|s|^2$ is odd]}\\[4pt] \implies\;&|s|^2 = 1&&\text{[since $\gcd(c,d)=1$]}\\[4pt] \end{align*}
so $s$ is a unit of $Z[i]$, as was to be shown.