Let $g:\mathbb{N} \to \mathbb{N}$ with $g(n)$ being the product of the digits of $n$.

(a) Prove that $g(n) \le n$ for all $n\in \mathbb{N}$

(b) Find all $n\in \mathbb{N}$ for which $n^2-12n+36=g(n)$
(a) To prove that \( g(n) \leq n \) for all \( n \in \mathbb{N} \), we start by expressing \( n \) in terms of its digits. Let \( n \) be represented as:
\[ n = \sum_{i=0}^{k} 10^i a_i \]
where \( a_i \) are the digits of \( n \).

We need to show that:
\[ \sum_{i=0}^{k} 10^i a_i \geq \prod_{j=0}^{k} a_j \]

We will use mathematical induction on the number of digits \( k+1 \).

**Base Case:**
For \( k = 0 \), \( n = a_0 \) and \( g(n) = a_0 \). Clearly, \( a_0 \leq a_0 \), so the base case holds.

**Inductive Step:**
Assume that for some \( k = m \), the statement holds:
\[ \sum_{i=0}^{m} 10^i a_i \geq \prod_{j=0}^{m} a_j \]

We need to show that it holds for \( k = m+1 \). Consider:
\[ n = \sum_{i=0}^{m+1} 10^i a_i \]

We have:
\[ \sum_{i=0}^{m+1} 10^i a_i = 10^{m+1} a_{m+1} + \sum_{i=0}^{m} 10^i a_i \]

By the induction hypothesis:
\[ \sum_{i=0}^{m} 10^i a_i \geq \prod_{j=0}^{m} a_j \]

We need to show:
\[ 10^{m+1} a_{m+1} + \sum_{i=0}^{m} 10^i a_i \geq a_{m+1} \prod_{j=0}^{m} a_j \]

Since \( 10^{m+1} a_{m+1} \geq a_{m+1} \prod_{j=0}^{m} a_j - \prod_{j=0}^{m} a_j \) (because \( 10^{m+1} \geq \prod_{j=0}^{m} a_j \) for all digits \( a_i \leq 9 \)), we have:
\[ 10^{m+1} a_{m+1} + \sum_{i=0}^{m} 10^i a_i \geq a_{m+1} \prod_{j=0}^{m} a_j \]

Thus, the statement holds for \( k = m+1 \). By induction, \( g(n) \leq n \) for all \( n \in \mathbb{N} \).

(b) We need to find all \( n \in \mathbb{N} \) for which:
\[ n^2 - 12n + 36 = g(n) \]

Using the result from part (a), we know \( g(n) \leq n \). Therefore:
\[ n^2 - 12n + 36 \leq n \]
\[ n^2 - 13n + 36 \leq 0 \]
\[ (n-4)(n-9) \leq 0 \]

This inequality holds for \( n \in [4, 9] \). Since \( n \in \mathbb{N} \), we have \( n = 4, 5, 6, 7, 8, 9 \).

We need to check which of these values satisfy:
\[ n^2 - 12n + 36 = g(n) \]
\[ (n-6)^2 = g(n) \]

Since \( n < 10 \), \( g(n) = n \). Therefore:
\[ (n-6)^2 = n \]

We solve for \( n \):
\[ n^2 - 12n + 36 = n \]
\[ n^2 - 13n + 36 = 0 \]
\[ (n-4)(n-9) = 0 \]

Thus, \( n = 4 \) or \( n = 9 \).

The final answer is \( \boxed{ n = 4, 9 } \)