A connected ring $A$ such that $A[1/f]$ is disconnected 
Let $A$ be a connected ring (i.e. $A$ has only trivial idempotents). Then for some $f \in A$, I wish to find a disconnected ring $A[1/f]:= \frac{A[x]}{\langle xf - 1 \rangle}$.

I have tried $A = \mathbb{C}[x],\mathbb{C}$ but I can't seem to choose the ring element such that I wind up with an idempotent in $A[1/f]$. Any help would be appreciated, thanks!
edit:
I think I have found an example:
Take an element $f$ which has been constructed such that it is a nilpotent in $A$, then $A[1/f]$ is the zero ring (I have proved this before).
my only issue is whether or not the zero ring is disconnected? thx
 A: Let $k$ be a field, let $B = k[x,y]/(xy)$ be the union of the two axes in the plane, let $\mathfrak{n} = (x,y)B$ be the maximal ideal of $B$ corresponding to the origin, and take $A = B_{\mathfrak{n}}$. Then $A$ has three prime ideals, namely $\mathfrak{m} = (x,y)A$, $\mathfrak{p}_{x} = (x)A$, $\mathfrak{p}_{y} = (y)A$. Note that $\mathfrak{p}_{x} \subseteq \mathfrak{m}$ and $\mathfrak{p}_{y} \subseteq \mathfrak{m}$ but neither of $\mathfrak{p}_{x},\mathfrak{p}_{y}$ contains the other. By prime avoidance, there exists some $f \in \mathfrak{m} \setminus (\mathfrak{p}_{x} \cup \mathfrak{p}_{y})$, for example $f = x+y$. Thus $A[\frac{1}{f}] \simeq k(x) \times k(y)$.
(Why do other elements of $\mathfrak{m} \setminus (\mathfrak{p}_{x} \cup \mathfrak{p}_{y})$ become units as soon as you invert $x+y$? Note that $(x+y)^{n} = x^{n} + y^{n}$ is a unit; if $m,n \ge 1$ and $a,b \in k^{\times}$ then $ax^{m}+by^{n}$ is a unit since $(ax^{m}+by^{n})(bx^{n}+ay^{m}) = ab(x^{m+n} + y^{m+n})$ is a unit; and if $f,g \in k[t]$ are polynomials with nonzero constant coefficient, then $x^{m}f(x) + y^{n}g(y) = (\frac{1}{g(0)}x^{m}+\frac{1}{f(0)}y^{n})f(x)g(y)$.)
Edit: As Zach Teitler points out in the comments, we can modify this example to construct such $A,f$ such that $A[\frac{1}{f}]$ has arbitrarily many connected components. For this let me take $k$ to have characteristic $0$ (so that I have infinitely many linear polynomials passing through the origin), set $B = k[x,y]/((x-y) \dotsb (x-my))$, then proceed as above.
We can also use results of Hochster [1] and Lewis [2], who showed that every finite poset can be realized as the poset of the spectrum of a ring; then proceed as above using the prime avoidance lemma.
[1] M. Hochster, "Prime ideal structure in commutative rings", Trans. Amer. Math. Soc. 142 (1969)
[2] W. Lewis, "The spectrum of a ring as a partially ordered set", J. Algebra 25 (1973)
