I have a function $f \in \mathbb{N}$ that is nonincreasing for $x,y \in \mathbb{N}$.
Now I have to prove that the set $$A:=\{f \in \mathbb{N}^{\mathbb{N}} | f\ \text{ is nonincreasing} \}$$ is countable.
I know that I can use the definition: A is countable if there exists an injective function $f: A \rightarrow \mathbb{N}$.
I don't see a way to prove it with that definition because the a nonincreasing function isn't always injective.
I don't think it is feasible to write an argument just by definition (more on this below).
You may write $$\tag1A=\bigcup_n A_n,$$ where $$A_n=\{f:\mathbb N\to\mathbb N:\ f(1)=n\}.$$If we show that each $A_n$ is countable, then it follows from $(1)$ that $A$ is countable. Now, each function in $A_n$ takes finitely many values, since $f(\mathbb N)\subset \{1,2,\ldots,n\}$. So each $f\in A_n$ can be uniquely identified by pairs $\{(n_j,m_j)\}_{j=1}^r$, where $n_j\in\mathbb N$ and $n=m_1>m_2>\cdots>m_r\geq1$. This allows us to identify $A_n$ as a subset of $$\bigcup_{r\in\mathbb N} \prod_{j=1}^r(\mathbb N\times \{1,2,\ldots,r\}). $$ This latter set is a countable union of countable sets, so it is itself countable, and thus $A_n$ is countable.
To write an argument "by definition" you would need to construct a map that enumerates all sets of pairs as above. Not impossible, but for sure tedious.