(The following is intended as a very brief and general introductory description of what academic philosophers take themselves to be up to.)
There is no uncontroversial answer to the question, “What is philosophy?” That said, here is a general account that many academic philosophers would recognize as describing what they do: philosophy is the project of understanding what the fundamental questions about our world and ourselves are, what good answers to such questions might be, and how such fundamental questions and answers relate to less fundamental matters, doing so using the skills of logical reasoning, imaginative thinking, and observation.
Other disciplines ask questions about us and our world. Physics, for example, seeks to understand what the universe is made of and how it operates, identifying particles and forces. Psychology aims to understand why people act as they do. How are they different from philosophy? In a few ways. First, these and other sciences answer their questions about the world largely through empirical investigation, conducting experiments and describing the physical world and the things and people in it. Philosophers tend to rely much less on these tools. This is because—and this brings us to the second difference—the kinds of questions philosophers ask tend not to be completely answerable using such tools. Some of the questions are more fundamental. The physicist wants to know about the universe; the philosopher wants to know what knowledge itself is. The physicist seeks to identify what things are made of; the philosopher wants to know why there is anything at all, rather than nothing. Other philosophical questions aren’t about how things are, but how they should be. The psychologist may be able to tell us how people tend to act under certain circumstances. The philosopher asks how should people act? (And what is an “action”?) What makes for a good person? (And what is a “person”?) The tools of science alone are not suited to taking up these kinds of questions.
There are other largely non-scientific domains that seek to help us understand the world and our place in it, such as literature and history. How do they differ from philosophy? Again, there is a difference in approach. Literature makes use of stories, characters, and imagery. While philosophy may make use of literature and fanciful examples, its main tool is careful, rigorous, logical argumentation. Philosophy also raises basic questions about the very components of literature, asking, for example, what it means for a word to mean something. Likewise, history can tell us what events happened when, and can offer explanations as to why, and philosophers may make use of all that, but the focus is different. Philosophers might ask: “how do we individuate events?” for example, or “what is time?” or “what is it for one event to cause another?”
While we do not have a precise and universally accepted definition of philosophy, the foregoing may clarify the subject enough to begin thinking about it. In fact, you might already have been thinking about it. Some people argue that we start philosophizing as children, when we ask, over and over again, in response to successive answers, “why?”—ultimately getting to assertions for which it is difficult to conceive what might count as an answer to the next “why” question about it.
When we come to identify our underlying beliefs, and, still curious, ask why we believe them—that is, what reasons justify them—we are indeed doing philosophy.