Bag I has 7 red and 3 green balls. Bag II has 3 red and 17 green.
(a) If the ball selected was a green, then what is the probability that Bag I was selected, and what is the probability that Bag II was selected?
Let $G_1, G_2$ be the event of selecting a green ball in the first or second draw, and $B_{\rm I}, B_{\rm II}$ be the event of selecting the respective bag.
Then you may use Bayes' Rule (and the Law of Total Probability):$$\mathsf P(B_{\rm I}\mid G_1)=\dfrac{\mathsf P(B_{\rm I})~\mathsf P(G_1\mid B_{\rm I})}{\mathsf P(B_{\rm I})~\mathsf P(G_1\mid B_{\rm I})+\mathsf P(B_{\rm II})~\mathsf P(G_1\mid B_{\rm II})}$$
Likewise you can fine $\mathsf P(B_{\rm II}\mid G_1)$.
Alternatively, first principle reasonings about the probability weight of each individual green ball will suffice (each from the ten balls in the first bag are twice as likely to have been picked as each from the twenty balls in the second bag, and so when given that a green ball was selected, there the odds of it coming from the first bag (with three green balls) rather than the second (with seventeen green balls) is ...).
(b) If a second ball I choose from the same bag with first time, what is the probability that the ball will be green; what is the probability that the ball will be red?
Assuming you are seeking the conditional probability when given the first draw was green, then just use the Law of Total Probability.
$$\mathsf P(G_2\mid G_1)=\mathsf P(G_2\mid B_{\rm I},G_1)~\mathsf P(B_{\rm I}\mid G_1)+\mathsf P(G_2\mid B_{\rm II},G_1)~\mathsf P(B_{\rm II}\mid G_1)$$
Further, if the draws are with replacement, then the draws are conditionally independent for a given bag, and things simplify:
$$\mathsf P(G_2\mid G_1)=\mathsf P(G_2\mid B_{\rm I})~\mathsf P(B_{\rm I}\mid G_1)+\mathsf P(G_2\mid B_{\rm II})~\mathsf P(B_{\rm II}\mid G_1)$$