Is this construction of an example of embedding correct?
We want to construct an example for the embedding $S^1\times S^1\rightarrow S^3$.
We define $f:S^1\times S^1\rightarrow S^3$ by
$f(\theta, \phi)=(\frac{1}{\sqrt{2}}cos\theta,\frac{1}{\sqrt{2}}sin\theta, \frac{1}{\sqrt{2}}cos\phi, \frac{1}{\sqrt{2}}sin\phi)$.
Obviously, $f$ is well-defined. We know $f$ is injective as it assigns to each point $(\theta, \phi)$ a unique point on $S^3$. The sine and cosine functions together cover the unit circle uniquely for each $\theta$ and $\phi$ in the domain $[0,2\pi]$. The only overlaps that occurs in $[0,2\pi]$ for each variable corresponds to the same point on $S^1$, the unit circle. $S^1\times S^1$ gives a torus. So, each point on the torus is uniquely defined by each $(\theta, \phi)$, and each $(\theta, \phi)$gives a unique point on $S^3$ due to the orthogonal nature of the sine and cosine functions for each dimension.
Since the components of $f$ are the sine and cosine functions, which are continuous, then $f$ is continuous. Also, since $S^1$ is compact, then $S^1\times S^1$ is compact (the product of two compact set is compact). Also, $S^3$ is Hausdorff (since $\mathbb{R}^4$ is Hausdorff, and $S^3\subseteq \mathbb{R}^4$). Since $f$ is continuous and injective, and is the map between a compact space and a Hausdorff space, then it is a homeomorphism.
Lastly, the differential $D_pf$ at $p=(\theta, \phi)$ gives a matrix with a full rank (a rank of 2) for any $\theta$ and $\phi$ because the rows are linearly independent (as both the sine and cosine functions do not vanish simultaneously). By the inverse function theorem, $f$ is locally injective. Hence, $f$ is an immersion.
Since f is a homeomorphism and an immersion, then f is an embedding.
You should avoid the use of $\sin$ and $\cos$. Actually your definition simply says that $$f((x_1,y_1),(x_2,y_2)) = \frac{1}{\sqrt 2}(x_1,y_1,x_2,y_2) .$$ This map is a continuous injection, hence a topological embedding.
$f$ is the restriction of the smooth map $$F : \mathbb R^2 \times \mathbb R^2 = \mathbb R^4 \to \mathbb R^4, F((x_1,y_1),(x_2,y_2)) = \frac{1}{\sqrt 2}(x_1,y_1,x_2,y_2) .$$ Note that $F$ is essentially the identity (with a scaling factor).
Since $S^1 \times S^1$ is a smooth submanifold of $\mathbb R^2 \times \mathbb R^2$ and $S^3$ is a smooth submanifold of $\mathbb R^4$, we see that $f$ is smooth:
$\require{AMScd}$ \begin{CD} S^1 \times S^1 @>{f}>> S^3 \\ @V{i}VV @VV{j}V \\ \mathbb R^2 \times \mathbb R^2 @>>{F}> \mathbb R^4 \end{CD}
The maps $i, j$ are the inclusions. For the differentials we get the commutative diagram $\require{AMScd}$ \begin{CD} T_{(a,b)}S^1 \times S^1 @>{D_{(a,b)}f}>> T_{f(a,b)}S^3 \\ @V{D_{(a,b)}i}VV @VV{D_{f(a,b)}j}V \\ T_{(a,b)}\mathbb R^2 \times \mathbb R^2 @>>{D_{(a,b)}F}> T_{F(a,b)}\mathbb R^4 \end{CD}
Since $D_{(a,b)}i$ and $D_{(a,b)}F$ are injective, also $D_{(a,b)}f$ must be injective. This proves that $f$ is an immersion.