Two types of verbs act as both verbs as well as nouns: Gerunds and Infinitives.
What are gerunds and infinitives? They're both non-finite verbs, i.e., derived from a verb but without a subject (because it functions as a noun). Let's look at the gerunds first:
A gerund is a verb form that ends in ing, for example, read + ing = reading. It works like a noun: as a subject, object, complement of a verb or the object of a preposition.
As a subject: For example, Walking is the best exercise, where walking is a gerund that is the subject of the verb is.
As an object: For example, Neil loves reading, where reading is an object of the verb loves.
As the complement of a verb: For example, My favourite activity is singing, where singing is the complement of the verb is.
As the object of a preposition: For example, She is good at dancing, where dancing is the object of the preposition at.
Gerunds must not be confused with participles, which take the same form verb + ing. The difference is that a gerund functions as a noun and a participle functions as an adjective.
We've looked at gerunds, now let's take a look at infinitives.
An infinitive takes the form to + verb, such as to play, to read and so on. It functions in the same way as the gerund.
As the subject of a verb: For example, To err is human, to forgive is divine, where to err and to forgive are both subjects of the verb is.
As the object of a verb: For example, She likes to play, where to play is the object of the verb likes.
As the complement of a verb: For example, She seems to be upset, where to be is the complement of the verb seems.
As the object of a preposition: For example, I was about to leave, where to leave is the object of the preposition about.