to learn/learn/learning

  1. And a great way to do that is to learn/learn/learning software engineering and computer science. Sadly, we don’t have enough opportunities for people to do that.
  2. To study well and learn any subject is to learn/learn/learning how to think with discipline within that subject.
    I have heard that in these sentences like this both “to learn” and “learn” are correct.
    Could you explain more about this?
    And why “learning” is wrong?

“learn” is wrong in both cases. If you want to use “learning” in #1 then it should be “by learning”. “learning” doesn’t work in #2.

“to learn” is correct in both cases, though I do question whether the second one totally makes sense under close scrutiny. I think one is guided by the parallelism:

And a great way to do that is to learn software engineering and computer science.
To study well and learn any subject is to learn how to think with discipline within that subject.

Dozy,

  1. And a great way to do that is by learning software engineering and computer science.
  2. To study well and learn any subject is by learning how to think with discipline within that subject.
    While #1 is correct, how could you say that #2 is wrong?
    Both are following the same structure only.
  3. Studying well and learning any subject is by learning how to think with discipline within that subject.
    Is #3 is correct?

#1 works because you can do/achieve things by learning. #2 does not begin with a pattern of words that makes sense with “is by learning…”

No. It would be grammatical if the word “by” was deleted.