A man has $7$ distinct balls. The experiment is to drop $1$ ball at a time down a chute to his friend (each drop is an independent trial), who chose which ball he wanted to receive before the experiment started. If he receives his desired ball, the experiment ends. If he doesn't receive his desired ball, he sends the ball back up the chute and the man at the top adds the ball back into his pile to choose from (so this man picks balls with replacement). However, the man picking balls is drunk and therefore immediately forgets whatever ball he had thrown down the chute last (so the probability of each ball leading to success is always $\frac 17$).
Let $X$ be the number of trials the man needs until he succeeds.
So far, I have $\operatorname{Range}(X) = \{1,2,3,\ldots\}$ and the expected value $E(X) = 7$ (because the distribution is geometric and therefore $E(X) =\frac 1p = \frac 1{1/7} = 7$).
How do I solve for the variance of $X$?
Also, how would I solve for the variance of $X$ if the experiment were exactly the same except without replacement?
Variance is defined as $\mathbb{E}\left[\left(X-\mu\right)^2\right] = \mathbb{E}\left[X^2\right]-\mathbb{E}\left[X\right]^2$. The PMF is given by the probability of failing the previous times and succeeding on the $n$ roll, so it is $$P(X=n) = (1-p)^{n-1}p$$
Then $\mathbb{E}\left[X\right]$ is $\frac{1}{p}$, as you got already, and $$\mathbb{E}\left[X^2\right] = \sum_{n=1}^{\infty} P(X=n)n^2 = \sum_{n=1}^{\infty} (1-p)^{n-1}pn^2$$
Equivalently, this sum is $$p\sum_{n=0}^{\infty}(1-p)^nn^2 + 2p\sum_{n=0}^{\infty}(1-p)^nn + p\sum_{n=0}^{\infty}(1-p)^n$$
Using that $\sum_{n=0}^{\infty}x^n = \frac{1}{1-x}$ and differentiating, this is equal to $$\frac{2-p}{p^2}$$
So the variance would be $$\frac{2-p}{p^2} - \frac{1}{p^2} = \frac{1-p}{p^2}$$ which is what is expected from a geometric distribution.
Edit: For $p = \frac{1}{7}$ as in the question, the variance is $42$.