Defining a function in parts

How can I define a piecewise function in Mathematica?

I'm trying to define f_{A}(x)=\left\{\begin{aligned} 1, \quad x \in A\\ 0, \quad x\notin A \end{aligned}\right. where $$A\subseteq \mathbb{R}$$.

Clear["*"];
`