To show that $\mathcal{F} \subset \mathcal{B}$, we must show that if $f^{-1}(A)$ is Borel measurable, then $A$ is Borel measurable.
For this, suppose that $A \subset \mathbb{R}$ with $f^{-1}(A) \in \mathcal{B}(\mathbb{R})$. We take two cases according to whether $A$ contains $0$. In either case, the key insight is that the continuous image of a Borel set under an injective function $g: \mathbb{R} \to \mathbb{R}$ is again a Borel set. (For a proof, see Image of Borel set under continuous and injective map.) I guess it should be noted that the same still holds if the domain of $g$ is instead an interval.
Since $f$ is surjective, we have
$$
A = f(f^{-1}(A)), \tag{1}.
$$
That is, $A$ is the image of $f^{-1}(A)$ under $f$. Of course, $f$ is not injective, but we will decompose the domain of $f$ into intervals so that the restriction of $f$ to each interval is injective.
Specifically, for each $j \in \mathbb{Z}$, let $f_j$ be the restriction of $f$ to the interval $(-\frac{\pi}{2}, \frac{\pi}{2}) + 2 \pi j$. Each function $f_j$ is a continuous bijection of its domain onto $\mathbb{R}$, and each of the sets $f_j^{-1}(A)$ is in $\mathcal{B}(\mathbb{R})$, because we can write each as the intersection of Borel sets; specifically, we have
$
f_j^{-1}(A) = f^{-1}(A) \cap \left(\left(-\frac{\pi}{2}, \frac{\pi}{2} \right) + 2 \pi j \right).
$
If $A$ does not contain $0$, then we can write
$
f^{-1}(A) = \bigcup_{j \in \mathbb{Z}} f_j^{-1}(A),
$
in which case equation (1) becomes
$$
A = f \left( \bigcup_{j \in \mathbb{Z}} f_j^{-1}(A) \right)
= \bigcup_{j \in \mathbb{Z}} f \left( f_j^{-1}(A) \right)
= \bigcup_{j \in \mathbb{Z}}f_j \left( f_j^{-1}(A) \right).
$$
Since each set $f_j^{-1}(A)$ is in $\mathcal{B}(\mathbb{R})$ and each function $f_j$ is injective on its domain, $f_j \left( f_j^{-1}(A) \right)$ is in $\mathcal{B}(\mathbb{R})$ for each $j$, which means that $A \in \mathcal{B}(\mathbb{R})$.
In the case that $A$ does contain $0$, the proof works almost the same way. We let
$
S = \left \{\dots, -\frac{5 \pi}{2}, -\frac{3 \pi}{2}, -\frac{\pi}{2}, -\frac{\pi}{2}, \frac{3 \pi}{2}, \frac{5 \pi}{2}, \dots \right \}.
$
Then we have that
$
f^{-1}(A) = S \cup \bigcup_{j \in \mathbb{Z}} f_j^{-1}(A),
$
and, consequently,
$$
A = f(S) \cup f \left( \bigcup_{j \in \mathbb{Z}} f_j^{-1}(A) \right) = \{ 0 \} \cup \bigcup_{j \in \mathbb{Z}}f_j \left( f_j^{-1}(A) \right).
$$
Thus, $A$ is a countable union of Borel measurable sets, which means that $A$ is Borel measurable.