Even your first part is not quite correct. $x + yi = \{(x,\ y)\}$ seems to say that $x+yi$ is the set whose only element is the ordered pair $(x,y)$ -- but usually one defines a complex number to be that ordered pair itself. That is, if one uses the definition of complex numbers as ordered pairs in the first place, which is common but not the only way to go. One could also define complex numbers as residue classes in the quotient ring $\mathbb R[X]/(X^2+1)$ or as real matrices of the form $\pmatrix{a&b\\-b&a}$, for example.
The second part of your question is more interesting. (Your use of symbols is rather off, as others have remarked, but I'll not dwell on that). The convention that real numbers "are equal to" certain complex numbers looks rather suspect when those complex numbers themselves are defined as structures that contain the real numbers in the first place.
What one usually does about this is sweep it under the rug as much as possible. At best, the textbook will contain a remark that what we really mean is that there is an injection $\mathbb R\to\mathbb C$ that preserves the behavior of the real numbers. From that point un, the reader is tacitly assumed to keep track of what is what and mentally insert "invisible" applications of that injection into formulas as required to get them to make sense.
This seems to work fine in practice -- at least inasmuch as working mathematicians don't think it confuses them and are generally able to pinpoint exactly where the reinterpretations are needed, provided that you can communicate to them what it is you want, because the request is so rare as to be "strange". But nobody seriously doubts that mathematics as it is commonly done can be formalized with explicit conversions between $\mathbb R$ and $\mathbb C$ if one cares to put in the effort.
Still, I don't think it is really satisfactory that nobody seems to want to put in the effort of formalizing some rules to govern this implicit reinterpretation. I think it would be quite doable, borrowing form the quite powerful techniques that has been developed in computer science for type systems for programming languages. But that's a hobby horse of my own and not something that appears to bother mathematics in general.
By the way, it's not just complex numbers that exhibit the problem. We run into exactly the same situation when we use the rational numbers to construct the reals (using Dedekind cuts or Cauchy sequences) and then declare that some of those real numbers equal certain rationals. Or when we use integers to construct the rationals (which contain the integers), or use the natural numbers to construct the integers (which contain the naturals).