Expressing an infinite saw wave function using unit step function graph of $f(t)$ above 

Find $a_n,f_n$ such that $$f(t)=\sum_{n=0}^{\infty}U(t-a_n)f_n(t-a_n).$$where $U$ is the unit step function / Heaviside function.

I tried $$\begin{align}
f(t) = \begin{cases} \frac{-2t}{\pi}+4n+1 &\mbox{if } 2n\pi \leq t \leq (2n+1)\pi &\mbox{and } n = 0, 1, 2, \cdots \\
\frac{2t}{\pi}-4n+1 &\mbox{if } (2n+1)\pi \leq t \lt (2n+2)\pi &\mbox{and } n = 0, 1, 2, \cdots \end{cases} 
\end{align}$$ as an intermediate step (I planned to then express the piecewise notation in terms of the unit step function), but that looks too ugly to be right.
 A: Let 
$$
g(t) = -\frac{2}{\pi}t + 1,\quad h(t) = \frac{2}{\pi}t - 1
$$
for $t\in [0,\pi)$.
Restrict $f$ on $[0,\pi)$:
$$
f_1(t) = -\frac{2}{\pi}t + 1 =  g(t).
$$
Restrict $f$ on $[\pi,2\pi)$, we get $h$ shifted to right by $\pi$:
$$
f_2(t) =  \frac{2}{\pi}t -3  =  h(t-\pi).
$$
Combining these two we have on $[0,2\pi)$: 
$$
f(t) = U(t-0)f_1(t) + U(t-\pi)\big(f_2(t) - f_1(t)\big)
$$
notice when using step function to represent something on the second interval we have to subtract whatever in the first otherwise we are counting it twice. 
Now in $[2\pi,3\pi)$, the restriction of $f$ is $g$ shifted to the right by $ 2\pi$
$$
f_3(t) = g(t-2\pi),
$$
and on $[0,3\pi)$
$$
f(t) = U(t-0)f_1(t) + U(t-\pi)\big(f_2(t) - f_1(t)\big) + U(t-2\pi)\big(f_3(t) - f_2(t)\big).
$$
Did you see a pattern here? If we let $f_0(t) = 0$
$$
f(t) = \sum^{\infty}_{n=0} U(t -\color{blue}{n\pi} )\big(f_{n+1}(t) - f_n(t)\big),\tag{$\star$}
$$
where the blue term is the $a_n$. Now for $n\geq 1$, we can split the term into even index terms and odd index terms, let $k = 1,2,3,\dots$
$$
f_{n+1}(t) - f_n(t) = \begin{cases}
g(t-n\pi) - h\big(t-(n-1)\pi\big) &\text{when } n = 2k,
\\[5pt]
h(t-n\pi) - g\big(t-(n-1)\pi\big) &\text{when } n =2k-1.
\end{cases}
$$
Now 
$$
g(t-n\pi) - h\big(t-(n-1)\pi\big) = -\frac{2}{\pi}(t-n\pi) + 1 - \frac{2}{\pi}\big(t-(n-1)\pi\big) + 1 = -\frac{4}{\pi}(t-n\pi),
$$ 
hence every even index term can be written as:
$$
U(t -a_n )\Phi(t-a_n),
$$
where $a_n=n\pi$, and $\Phi = -4t/\pi$. Do the same for the odd index terms and eventually you can combine them too using absolute value.
A: The formula for the first "reverse triangle" is $\frac{2}{\pi}|t-\pi|-1$. Since we want to restrict this piece to the interval $t \in [0,2\pi]$ we can form $$\left(\frac{2}{\pi}|t-\pi|-1 \right) \cdot(U(t-0)-U(t-2\pi)) $$ The factor on the right gives $1$ in between $0,2\pi$ and $0$ otherwise. All you need to do now is sum up translated versions of this "basic function". 
