If there are $6$ digits with $36$ possible values each, I think there are $36^6$ possible combinations altogether.
Regardless of the exact number of combinations, your reasoning for part (a) is sound.
For part (b), if you keep on making guesses indefinitely (not stopping after you
guess the correct password), then eventually you will guess the same value twice
in a row with probability $1$ (for reasons similar to part (a)).
If the question is which will happen first, guessing the correct password
or making the same guess twice consecutively,
consider that after the first guess, each time you guess another sequence of six digits
you have an equal chance to guess the correct password or to guess the same sequence
as the previous guess.
There is a possibility that you will guess the correct password on the very first
attempt, however.
Addendum: Calculations for part (b).
If you interpret the problem to mean that guessing will stop when a correct password
is guessed, then one way to work the answer is as follows.
Let $p$ be the probability of each possible outcome of each guess.
In this particular problem, $p = \frac1{36^6}.$
Consider the first pair of consecutive guesses that are the same.
For this to occur on guesses number $n+1$ and $n+2$ requires the following sequence
of events:
- The first guess is not the correct password. This occurs with probability $1-p.$
- Each of the next $n$ guesses is neither the correct password nor the same as the previous guess. Each of these events has probability $1-2p$ given that all the previously required events occurred (that is, given that no previous guess was the correct password).
- The guess after that sequence (that is, guess number $n+2$) is the same as the guess before it. This occurs with probability $p.$
This is the story for any non-negative integer $n$, and there is no other way to
guess the same password twice. Moreover, the cases for $n = 0, 1, 2, \ldots$
are all disjoint outcomes, since you can only have one "first pair of
equal guesses" in any given experiment. The probability that we will have at least
one pair of consecutive equal guesses is therefore the sum of probabilities
over all these cases:
$$\sum_{n=0}^\infty p(1-p) (1-2p)^n.$$
This is the sum of a geometric series, so it is not hard to evaluate.
A simpler method is to consider that to guess the same password twice, our first guess
must differ from the correct password (which happens with probability $1-p$),
and on each guess after that we have an equal chance either to guess correctly
(in which case we stop guessing) or to guess the same password as the previous guess.
By symmetry, neither of these events is more likely than the other to occur first.
But if a correct guess occurs first, then we never have a duplicate,
whereas if a duplicate guess occurs first then of course we do have a duplicate.
That gives us a $\frac12$ chance of a duplicate if the first guess is not correct,
which gives us an overall probability of $\frac12(1-p).$