Let $A$ be a principal ideal domain and $S = \{a_1,...,a_n \}$ a subset of $A$ and let $(S)$ be the ideal generated by the elements of $S$. Define $T_S = \{t \in A \ \vert \ \forall i =1,...,n, t \mid a_i \}$.
Show that $(S) = A \Leftrightarrow T_S \subset A^\times$, where $A^\times$ denotes the group of units.
$\Leftarrow:$ If $T_S \subset A^\times$ then for $t \in T_S$, we have that $t \in A^\times$. Thus $t$ is invertible and from the definition of $T_S$ we know that $t \vert a_i, \forall i$. From here I don't know how to proceed.
Let the ideal generated by $S$ be given by $(f)$ for some $f \in A$.
Note that $f \in T_S$ so if $T_S \subseteq A^\times$, then $f$ is a unit so $(f) = (1) = A$. Conversely, if $\langle S\rangle = (1)$, then we can write $1 = \sum_{i = 1}^n c_i a_i$ by the definition of the ideal generated by $S$. Hence, if some $t$ divides all $a_i$, it divides every $c_i a_i$ so that $t$ divides the sum, which is 1. Hence, $t$ is a unit so $T_S \subseteq A^\times$.