One way to see this is to use the (very useful) universal property of localization:
Universal property of localization:
Let $A$ be a ring, $S$ a multiplicative subset, and $i:A\to S^{-1}A$ the natural map. Then given any ring morphism $\varphi:A\to B$ such that $\varphi(S)\subseteq B^*$, there exists a unique morphism $u:S^{-1}A\to B$ such that $\varphi=u\circ i$, i.e. the following commutes:
$$\begin{array}{ccc} A & \rightarrow & B\\
\downarrow & \nearrow \\
S^{-1}A & &\end{array}$$
How to use this here? Well, suppose you have a map $\varphi:A\to B$ such that $\varphi(S_f)\subseteq B^*$. This is the same as saying $\varphi(f)$ is invertible, call this element $y$. Then extend $\varphi$ to a map $A[x]\to B$ by sending $x\mapsto y^{-1}$. Since clearly $(xf-1)\mapsto0$, this induces a map $u:A[x]/(xf-1)\to B$. It's not hard to see that this map satisfies the desired properties, so indeed $A[f^{-1}]$ satisfies the universal property of $S_f^{-1}A$ and the two must be isomorphic.
As for your second question, as far as I know there isn't a nice way to describe localizations in general using generators and relations. That's really why we use this messy construction anyways; if we always had a simple description like in the case of $S=\{1,f,f^2,\dots\}$, then we'd just use that instead.