$\newcommand{\lap}{\mathscr{L}}\newcommand{\dd}{\mathrm{d}}$
Let us use $A=1$.
Approach #1 (involves integration)
Function $f$ is periodic with period $T$.
In fact, it suffices to defive this function over the interval $[0, T]$
\begin{equation}
f(t) = \begin{cases}
1,&\text{ for } 0 \leq t < \tfrac{T}{2}
\\
-1, &\text{ for } \tfrac{T}{2} < t \leq T
\end{cases}.
\end{equation}
As a result, the Laplace transform of $f$ exists and it is given by
\begin{align*}
\lap\{f\}(s) {}={}&
\frac{1}{1-e^{-Ts}}\int_0^{T}e^{-s\tau}f(\tau)\dd\tau
\\
{}={}&
\frac{1}{1-e^{-2Ts}} \left(\int_0^{\tfrac{T}{2}}e^{-s\tau}\dd\tau - \int_{\tfrac{T}{2}}^{T}e^{-s\tau}\dd\tau \right)
\\
{}={}&
\frac{1}{1-e^{-2Ts}}
\left(
\left.-\tfrac{1}{s}e^{-s\tau}\right|_0^{\tfrac{T}{2}}
{}+{}
\left.\tfrac{1}{s}e^{-s\tau}\right|_{\tfrac{T}{2}}^{T}
\right)
\\
{}={}&
\ldots
\\
{}={}& \frac{1}{s}\frac{e^{\tfrac{Ts}{2}}-1}{e^{\tfrac{Ts}{2}}+1}
{}={}
\frac{1}{s}\tanh\left(\tfrac{Ts}{4}\right).
\end{align*}
I like @alexjo's answer, but we need to use the dominated convergence theorem to guarantee that we can interchange the Laplace transform and the series.
Approach #2 (no integration needed)
We can determine the Laplace transform of a periodic function without the need to compute any integrals. In fact, the Laplace transform of a periodic function boils down to determining the Laplace transform of another function [1, Thm. 4.25].
Firstly, note that we can write $f(t)=1 -2 H_{\frac{T}{2}}(t)$ for $t\in[0, T]$.
We can employ Theorem 4.25 from [1] (I am the author of this book), according to which
$$
(\lap f)(s) = \frac{(\lap f_0)(s)}{1-e^{-sT}},\tag{$*$}
$$
where $f_0(t) = f(t)(1-H_T(s)).$ We have
\begin{aligned}
f_0(t) {}={}& \left(1 -2 H_{\frac{T}{2}}(t)\right)(1-H_T(t)) \\ {}={}&
1-H_T(t)-2 H_{\frac{T}{2}}(t)+2H_{\frac{T}{2}}(t)H_T(t) \\ {}={}&
1-H_T(t)-2 H_{\frac{T}{2}}(t)+2H_T(t)\\ {}={}&
1+H_T(t)-2 H_{\frac{T}{2}}(t).
\end{aligned}
We can easily determine the Laplace transform of $f_0$ and then apply Equation ($*$).
The same trick can be applied to other periodic functions as well. You can have a look at [1, Example 4.13] where we deal with $f(t) = |\sin t|$ or Exercises 4.7 - 4.10.
[1] P. Sopasakis, Control systems: an introduction, Applied Mathematix Press, 2023